Class BusLine

    • Constructor Detail

      • BusLine

        public BusLine​(BusNetwork network,
                       String name)
        Create bus line with a memory-based attribute provider.
        Parameters:
        network - is the network which is containing this bus line.
        name - is the name of the new bus line
      • BusLine

        public BusLine​(UUID id,
                       BusNetwork network,
                       String name)
        Create bus line with a memory-based attribute provider.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        network - is the network which is containing this bus line.
        name - is the name of the new bus line
        Since:
        2.0
      • BusLine

        public BusLine​(BusNetwork network,
                       String name,
                       AttributeCollection attributeProvider)
        Create bus line.
        Parameters:
        network - is the network which is containing this bus line.
        name - is the name of the new bus line
        attributeProvider - the attribute provider.
      • BusLine

        public BusLine​(UUID id,
                       BusNetwork network,
                       String name,
                       AttributeCollection attributeProvider)
        Create bus line.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        network - is the network which is containing this bus line.
        name - is the name of the new bus line
        attributeProvider - the attribute provider.
        Since:
        2.0
      • BusLine

        public BusLine​(String name)
        Create bus line with a memory-based attribute provider.
        Parameters:
        name - is the name of the new bus line
      • BusLine

        public BusLine​(UUID id,
                       String name)
        Create bus line with a memory-based attribute provider.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        name - is the name of the new bus line
        Since:
        2.0
      • BusLine

        public BusLine​(String name,
                       AttributeCollection attributeProvider)
        Create bus line.
        Parameters:
        name - is the name of the new bus line
        attributeProvider - the attribute provider.
      • BusLine

        public BusLine​(UUID id,
                       String name,
                       AttributeCollection attributeProvider)
        Create bus line.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        name - is the name of the new bus line
        attributeProvider - the attribute provider.
        Since:
        2.0
      • BusLine

        public BusLine​(BusNetwork network)
        Create bus line with a memory-based attribute provider.
        Parameters:
        network - is the network which is containing this bus line.
      • BusLine

        public BusLine​(UUID id,
                       BusNetwork network)
        Create bus line with a memory-based attribute provider.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        network - is the network which is containing this bus line.
        Since:
        2.0
      • BusLine

        public BusLine​(BusNetwork network,
                       AttributeCollection attributeProvider)
        Create bus line.
        Parameters:
        network - is the network which is containing this bus line.
        attributeProvider - the attribute provider.
      • BusLine

        public BusLine​(UUID id,
                       BusNetwork network,
                       AttributeCollection attributeProvider)
        Create bus line.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        network - is the network which is containing this bus line.
        attributeProvider - the attribute provider.
        Since:
        2.0
      • BusLine

        public BusLine()
        Create bus line with a memory-based attribute provider.
      • BusLine

        public BusLine​(UUID id)
        Create bus line with a memory-based attribute provider.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        Since:
        2.0
      • BusLine

        public BusLine​(AttributeCollection attributeProvider)
        Create bus line.
        Parameters:
        attributeProvider - the attribute provider.
      • BusLine

        public BusLine​(UUID id,
                       AttributeCollection attributeProvider)
        Create bus line.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeProvider - the attribute provider.
        Since:
        2.0
    • Method Detail

      • getFirstFreeBusLineName

        public static String getFirstFreeBusLineName​(BusNetwork network)
        Replies a bus line name that was not exist in the specified network.
        Parameters:
        network - is the bus network from which a free bus line name may be computed.
        Returns:
        the name suitable for a bus line.
      • getElementType

        public Class<? extends BusItinerary> getElementType()
        Description copied from interface: InformedIterable
        Replies the class of the elements in this iterable object.
        Returns:
        the type of the elements.
      • getBusNetwork

        public BusNetwork getBusNetwork()
        Description copied from interface: BusPrimitive
        Replies the bus network in which this primitive is.
        Returns:
        the bus network in which this primitive is.
      • toPath2D

        @Pure
        public Path2d toPath2D()
        Replies the path representation of this itinerary.
        Returns:
        the path.
      • toPath2D

        @Pure
        public void toPath2D​(Path2d path)
        Replies the path representation of this itinerary.
        Parameters:
        path - the path to fill.
      • size

        public int size()
        Description copied from interface: GISContainer
        Replies the count of map elements inside this container.
        Returns:
        the count of map elements inside this container.
      • addBusItinerary

        public boolean addBusItinerary​(BusItinerary busItinerary)
        Add a bus itinerary inside the bus line.
        Parameters:
        busItinerary - is the bus itinerary to insert.
        Returns:
        true if the bus itinerary was added, otherwise false
      • addBusItinerary

        public boolean addBusItinerary​(BusItinerary busItinerary,
                                       int index)
        Add a bus itinerary at the specified index.
        Parameters:
        busItinerary - is the bus itinerary to insert.
        index - the index.
        Returns:
        true if the bus itinerary was added, otherwise false
      • removeAllBusItineraries

        public void removeAllBusItineraries()
        Remove all the bus itineraries from the current line.
      • removeBusItinerary

        public boolean removeBusItinerary​(BusItinerary itinerary)
        Remove a bus itinerary from this line. All the associated stops will be removed also.
        Parameters:
        itinerary - is the bus itinerary to remove.
        Returns:
        true if the bus itinerary was successfully removed, otherwise false
      • removeBusItinerary

        public boolean removeBusItinerary​(int index)
        Remove the bus itinerary at the specified index. All the associated stops will be removed also.
        Parameters:
        index - is the index of the bus itinerary to remove.
        Returns:
        true if the bus itinerary was successfully removed, otherwise false
      • getBusItineraryCount

        public int getBusItineraryCount()
        Replies the count of bus itineraries into this line.
        Returns:
        the count of bus itineraries into this line.
      • indexOf

        public int indexOf​(BusItinerary itinerary)
        Replies the index of the specified bus itinerary.
        Parameters:
        itinerary - is the bus itinerary to search for.
        Returns:
        the index or -1 if it was not found.
      • getBusItineraryAt

        public BusItinerary getBusItineraryAt​(int index)
        Replies the itinerary at the specified index.
        Parameters:
        index - the index.
        Returns:
        a bus itinerary
        Throws:
        IndexOutOfBoundsException - in case of error.
      • getBusItinerary

        public BusItinerary getBusItinerary​(String name)
        Replies the bus itinerary with the specified name.
        Parameters:
        name - is the desired name
        Returns:
        a bus itinerary or null
      • getBusItinerary

        public BusItinerary getBusItinerary​(UUID uuid)
        Replies the bus itinerary with the specified uuid.
        Parameters:
        uuid - the identifier.
        Returns:
        BusItinerary or null
      • getBusItinerary

        public BusItinerary getBusItinerary​(String name,
                                            Comparator<String> nameComparator)
        Replies the bus itinerary with the specified name.
        Parameters:
        name - is the desired name
        nameComparator - is used to compare the names.
        Returns:
        a bus itinerary or null
      • busItineraryIterator

        public Iterator<BusItinerary> busItineraryIterator()
        Replies the list of the bus itineraries of the bus line.
        Returns:
        a list of bus itineraries
      • busItineraries

        public Iterable<BusItinerary> busItineraries()
        Replies the list of the bus itineraries of the bus line.
        Returns:
        a list of bus itineraries