- java.lang.Object
-
- org.arakhne.afc.gis.primitive.AbstractGISElement<C,T>
-
- org.arakhne.afc.gis.primitive.AbstractBoundedGISElement<CONTAINER,AbstractBusPrimitive<CONTAINER>>
-
- org.arakhne.afc.gis.bus.network.AbstractBusPrimitive<CONTAINER>
-
- org.arakhne.afc.gis.bus.network.AbstractBusContainer<BusContainer<?>,BusLine>
-
- org.arakhne.afc.gis.bus.network.BusNetwork
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<BusLine>
,EventListener
,AttributeChangeListener
,AttributeCollection
,AttributeProvider
,BusChangeListener
,BusContainer<BusLine>
,BusPrimitive<BusContainer<?>>
,BoundedGISElement
,FlagContainer
,GISCloneable<AbstractBusPrimitive<BusContainer<?>>>
,GISContainer<BusLine>
,GISEditable
,GISElement
,GISFlagContainer
,GISPrimitive
,BoundedElement2afp<Rectangle2d>
,InformedIterable<BusLine>
,JsonableObject
public class BusNetwork extends AbstractBusContainer<BusContainer<?>,BusLine>
A bus network is composed ofbus lines
.Validation
A bus network is valid if it has at least one line and all its lines are valid in turn, and all bus stops are valid.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:56
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisbus
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.gis.bus.network.AbstractBusPrimitive
ATTR_COLOR, DEFAULT_COLOR
-
Fields inherited from interface org.arakhne.afc.gis.primitive.FlagContainer
FLAG_READONLY, FLAG_SELECTED
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISElement
ATTR_NAME, NAME_COMPARATOR
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description BusNetwork(String name, RoadNetwork roadNetwork)
Create bus network with a storage in memory of the attributes.BusNetwork(String name, RoadNetwork roadNetwork, AttributeCollection attributeProvider)
Create bus network.BusNetwork(UUID id, String name, RoadNetwork roadNetwork)
Create bus network with a storage in memory of the attributes.BusNetwork(UUID id, String name, RoadNetwork roadNetwork, AttributeCollection attributeProvider)
Create bus network.BusNetwork(UUID id, RoadNetwork roadNetwork)
Create bus network with a storage in memory of the attributes.BusNetwork(UUID id, RoadNetwork roadNetwork, AttributeCollection attributeProvider)
Create bus network.BusNetwork(RoadNetwork roadNetwork)
Create bus network with a storage in memory of the attributes.BusNetwork(RoadNetwork roadNetwork, AttributeCollection attributeProvider)
Create bus network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BusHub
addBusHub(String name, BusStop... stops)
Add a bus hub in this network.BusHub
addBusHub(BusStop... stops)
Add a bus hub in this network.boolean
addBusLine(BusLine busLine)
Add a bus line inside the bus network.boolean
addBusLine(BusLine busLine, int index)
Add a bus line at the specified index.boolean
addBusStop(BusStop busStop)
Add a bus stop inside the bus network.Iterator<BusHub>
busHubIterator()
Replies the list of the bus hubs of the bus network.Iterable<BusHub>
busHubs()
Replies the list of the bus hubs of the bus network.Iterator<BusLine>
busLineIterator()
Replies the list of the bus lines of the bus network.Iterable<BusLine>
busLines()
Replies the list of the bus lines of the bus network.Iterator<BusStop>
busStopIterator()
Replies the list of the bus stops of the bus network.Iterable<BusStop>
busStops()
Replies the list of the bus stops of the bus network.protected Rectangle2d
calcBounds()
Compute the bounds of this element.protected void
checkPrimitiveValidity()
Check if the validity of this primitive is correctly set and change its values if necessary.BusHub
getBusHub(String name)
Replies the bus hub with the specified name.BusHub
getBusHub(String name, Comparator<String> nameComparator)
Replies the bus hub with the specified name.BusHub
getBusHub(UUID uuid)
Replies the bus hub with the specified uuid.int
getBusHubCount()
Replies the count of bus hubs into this network.Iterator<BusHub>
getBusHubsIn(Rectangle2afp<?,?,?,?,?,?> clipBounds)
Replies the set of bus hubs that have an intersection with the specified rectangle.BusLine
getBusLine(String name)
Replies the bus line with the specified name.BusLine
getBusLine(String name, Comparator<String> nameComparator)
Replies the bus line with the specified name.BusLine
getBusLine(UUID uuid)
Replies the bus line with the specified uuid.BusLine
getBusLineAt(int index)
Replies the line at the specified index.int
getBusLineCount()
Replies the count of bus lines into this network.BusNetwork
getBusNetwork()
Replies the bus network in which this primitive is.BusStop
getBusStop(String name)
Replies the bus stop with the specified name.BusStop
getBusStop(String name, Comparator<String> nameComparator)
Replies the bus stop with the specified name.BusStop
getBusStop(UUID id)
Replies the bus stop with the specified id.int
getBusStopCount()
Replies the count of bus stops into this network.Iterator<BusStop>
getBusStopsIn(Rectangle2afp<?,?,?,?,?,?> clipBounds)
Replies the set of bus stops that have an intersection with the specified rectangle.Class<? extends BusLine>
getElementType()
Replies the class of the elements in this iterable object.BusHub
getNearestBusHub(double x, double y)
Replies the nearest bus hub to the given point.BusHub
getNearestBusHub(GeoLocationPoint point)
Replies the nearest bus hub to the given point.BusHub
getNearestBusHub(Point2D<?,?> point)
Replies the nearest bus hub to the given point.BusStop
getNearestBusStop(double x, double y)
Replies the nearest bus stops to the given point.BusStop
getNearestBusStop(GeoLocationPoint point)
Replies the nearest bus stop to the given point.BusStop
getNearestBusStop(Point2D<?,?> point)
Replies the nearest bus stop to the given point.RoadNetwork
getRoadNetwork()
Replies the road network in which this bus network is mapped.Shape2d<?>
getShape()
Replies the shape of this this element.int
indexInParent()
Replies the index of this primitive in its parent.int
indexOf(BusLine busLine)
Replies the index of the specified bus line.boolean
isValidBusHubs()
Replies if all the bus hubs are valid.boolean
isValidBusStops()
Replies if all the bus stops are valid.Iterator<BusLine>
iterator()
void
onBusPrimitiveChanged(BusChangeEvent event)
Invoked each time the bus primitive changed (excepts for graphical attributes).void
rebuild(boolean fireEvents)
Rebuild the primitive and all the primitive inside.void
removeAllBusHubs()
Remove all the bus hubs from the current network.void
removeAllBusLines()
Remove all the bus lines from the current network.void
removeAllBusStops()
Remove all the bus stops from the current network.boolean
removeBusHub(String name)
Remove the bus hub with the given name.boolean
removeBusHub(BusHub busHub)
Remove a bus hubs from this network.boolean
removeBusLine(int index)
Remove the bus line at the specified index.boolean
removeBusLine(String name)
Remove the bus line with the given name.boolean
removeBusLine(BusLine busLine)
Remove a bus line from this network.boolean
removeBusStop(String name)
Remove the bus stops with the given name.boolean
removeBusStop(BusStop busStop)
Remove a bus stop from this network.void
revalidate()
Check if the validity of this primitive is correctly set and change its values if necessary.int
size()
Replies the count of map elements inside this container.void
toJson(JsonBuffer buffer)
Replies the Json representation of this node.-
Methods inherited from class org.arakhne.afc.gis.bus.network.AbstractBusContainer
bindChangeListener, fireGraphicalAttributeChanged, fireShapeChanged, onBusPrimitiveGraphicalAttributeChanged, onBusPrimitiveShapeChanged
-
Methods inherited from class org.arakhne.afc.gis.bus.network.AbstractBusPrimitive
addBusChangeListener, addGISEditableChangeListener, addListener, finalize, fireGraphicalAttributeChanged, firePrimitiveChanged, firePrimitiveChanged, firePrimitiveChanged, fireShapeChanged, fireValidityChanged, fireValidityChangedFor, getColor, getColor, getFlags, getGeoLocation, getInvalidityReason, getRawColor, hasFlag, isReadOnlyObject, isValidPrimitive, onAttributeChanged, rebuild, removeBusChangeListener, removeGISEditableChangeListener, removeListener, setColor, setFlag, setPrimitiveValidity, setReadOnlyObject, setUUID, switchFlag, unsetFlag
-
Methods inherited from class org.arakhne.afc.gis.primitive.AbstractBoundedGISElement
clone, getBoundingBox, resetBoundingBox, setBoundingBox
-
Methods inherited from class org.arakhne.afc.gis.primitive.AbstractGISElement
addAttributeChangeListener, addAttributes, addAttributes, attributes, copyAttributes, flush, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCollection, getAttributeCount, getAttributeObject, getAttributeProvider, getContainer, getGeoId, getName, getTopContainer, getUUID, hasAttribute, hashKey, isEventFirable, onAttributeChangeEvent, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setContainer, setEventFirable, setName, toMap, toMap, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeCollection
addAttributeChangeListener, addAttributes, addAttributes, flush, isEventFirable, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setEventFirable
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
attributes, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCount, getAttributeObject, hasAttribute, toMap, toMap
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.BoundedElement2afp
getBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.BoundedGISElement
resetBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISContainer
getColor, getName, resetBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISEditable
getName, setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISElement
clone, copyAttributes, getName, hashKey, setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
getGeoId, getUUID
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
BusNetwork
public BusNetwork(String name, RoadNetwork roadNetwork, AttributeCollection attributeProvider)
Create bus network.- Parameters:
name
- is the name of the new bus networkroadNetwork
- is the road network on which the bus network is mapped.attributeProvider
- is the attribute provider which must be used by this object.
-
BusNetwork
public BusNetwork(UUID id, String name, RoadNetwork roadNetwork, AttributeCollection attributeProvider)
Create bus network.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.name
- is the name of the new bus networkroadNetwork
- is the road network on which the bus network is mapped.attributeProvider
- is the attribute provider which must be used by this object.- Since:
- 2.0
-
BusNetwork
public BusNetwork(RoadNetwork roadNetwork, AttributeCollection attributeProvider)
Create bus network.- Parameters:
roadNetwork
- is the road network on which the bus network is mapped.attributeProvider
- is the attribute provider which must be used by this object.
-
BusNetwork
public BusNetwork(UUID id, RoadNetwork roadNetwork, AttributeCollection attributeProvider)
Create bus network.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.roadNetwork
- is the road network on which the bus network is mapped.attributeProvider
- is the attribute provider which must be used by this object.- Since:
- 2.0
-
BusNetwork
public BusNetwork(String name, RoadNetwork roadNetwork)
Create bus network with a storage in memory of the attributes.- Parameters:
name
- is the name of the new bus networkroadNetwork
- is the road network on which the bus network is mapped.
-
BusNetwork
public BusNetwork(UUID id, String name, RoadNetwork roadNetwork)
Create bus network with a storage in memory of the attributes.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.name
- is the name of the new bus networkroadNetwork
- is the road network on which the bus network is mapped.- Since:
- 2.0
-
BusNetwork
public BusNetwork(RoadNetwork roadNetwork)
Create bus network with a storage in memory of the attributes.- Parameters:
roadNetwork
- is the road network on which the bus network is mapped.
-
BusNetwork
public BusNetwork(UUID id, RoadNetwork roadNetwork)
Create bus network with a storage in memory of the attributes.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.roadNetwork
- is the road network on which the bus network is mapped.- Since:
- 2.0
-
-
Method Detail
-
toJson
@Pure public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObject
Replies the Json representation of this node.- Specified by:
toJson
in interfaceJsonableObject
- Overrides:
toJson
in classAbstractBusPrimitive<BusContainer<?>>
- Parameters:
buffer
- the Json buffer.
-
rebuild
public void rebuild(boolean fireEvents)
Description copied from interface:BusPrimitive
Rebuild the primitive and all the primitive inside. Rebuilding means to reset all the internal values and recompute their values.This function should be invoked when the bus primitive was construct with its flag replied by
AttributeCollection.isEventFirable()
set tofalse
. This function permits to finalize the construction.In addition, this function automatically invoke
BoundedGISElement.resetBoundingBox()
and does the same job asBusPrimitive.revalidate()
(but does not invoke it). This function invokesAttributeCollection.setEventFirable(boolean)
withtrue
as parameter.- Parameters:
fireEvents
- indicates if the events should be fired.- See Also:
BusPrimitive.rebuild()
-
getElementType
public Class<? extends BusLine> getElementType()
Description copied from interface:InformedIterable
Replies the class of the elements in this iterable object.- Returns:
- the type of the elements.
-
getBusNetwork
@Pure 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.
-
getRoadNetwork
@Pure public RoadNetwork getRoadNetwork()
Replies the road network in which this bus network is mapped.- Returns:
- the road network in which this bus network is mapped.
-
calcBounds
@Pure protected Rectangle2d calcBounds()
Description copied from class:AbstractBoundedGISElement
Compute the bounds of this element. This function does not update the internal attribute replied byAbstractBoundedGISElement.getBoundingBox()
- Specified by:
calcBounds
in classAbstractBoundedGISElement<BusContainer<?>,AbstractBusPrimitive<BusContainer<?>>>
- Returns:
- the bounds
-
getShape
public Shape2d<?> getShape()
Description copied from interface:BoundedGISElement
Replies the shape of this this element.The bounding box replied by
BoundedElement2afp.getBoundingBox()
encloses the replied shape.- Returns:
- the shape or
null
if not applicable.
-
size
@Pure 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.
-
isValidBusStops
@Pure public boolean isValidBusStops()
Replies if all the bus stops are valid.- Returns:
true
if all the bus stops are valid, otherwisefalse
.
-
isValidBusHubs
@Pure public boolean isValidBusHubs()
Replies if all the bus hubs are valid.- Returns:
true
if all the bus hubs are valid, otherwisefalse
.
-
revalidate
public void revalidate()
Check if the validity of this primitive is correctly set and change its values if necessary. This function revalidate also all the primitives inside this primitive..Override this function to be sure that the invalid and valid collections has no impact of the iteration on the elements in this itinerary
- Specified by:
revalidate
in interfaceBusPrimitive<BusContainer<?>>
- Overrides:
revalidate
in classAbstractBusContainer<BusContainer<?>,BusLine>
- See Also:
checkPrimitiveValidity()
-
checkPrimitiveValidity
protected void checkPrimitiveValidity()
Description copied from class:AbstractBusPrimitive
Check if the validity of this primitive is correctly set and change its values if necessary. This function DO NOT revalidate the primitives inside this primitive.- Specified by:
checkPrimitiveValidity
in classAbstractBusPrimitive<BusContainer<?>>
- See Also:
AbstractBusPrimitive.revalidate()
-
addBusLine
public boolean addBusLine(BusLine busLine)
Add a bus line inside the bus network.- Parameters:
busLine
- is the bus line to insert.- Returns:
true
if the bus line was added, otherwisefalse
-
addBusLine
public boolean addBusLine(BusLine busLine, int index)
Add a bus line at the specified index.- Parameters:
busLine
- is the bus line to insert.index
- the index.- Returns:
true
if the bus line was added, otherwisefalse
-
removeAllBusLines
public void removeAllBusLines()
Remove all the bus lines from the current network.
-
removeBusLine
public boolean removeBusLine(BusLine busLine)
Remove a bus line from this network. All the itineraries and the associated stops will be removed also. If this bus line removal implies empty hubs, these hubs will be also removed.- Parameters:
busLine
- is the bus line to remove.- Returns:
true
if the bus line was successfully removed, otherwisefalse
-
removeBusLine
public boolean removeBusLine(String name)
Remove the bus line with the given name. All the itineraries and the associated stops will be removed also. If this bus line removal implies empty hubs, these hubs will be also removed.- Parameters:
name
- is the name of the bus line to remove.- Returns:
true
if the bus line was successfully removed, otherwisefalse
-
removeBusLine
public boolean removeBusLine(int index)
Remove the bus line at the specified index. All the itineraries and the associated stops will be removed also. If this bus line removal implies empty hubs, these hubs will be also removed.- Parameters:
index
- is the index of the bus line to remove.- Returns:
true
if the bus line was successfully removed, otherwisefalse
-
getBusLineCount
@Pure public int getBusLineCount()
Replies the count of bus lines into this network.- Returns:
- the count of bus lines into this network.
-
indexOf
@Pure public int indexOf(BusLine busLine)
Replies the index of the specified bus line.- Parameters:
busLine
- is the bus line to search for.- Returns:
- the index or
-1
if it was not found.
-
indexInParent
@Pure public int indexInParent()
Description copied from class:AbstractBusPrimitive
Replies the index of this primitive in its parent.- Specified by:
indexInParent
in classAbstractBusPrimitive<BusContainer<?>>
- Returns:
- the index of this primitive in its parent.
-
getBusLineAt
@Pure public BusLine getBusLineAt(int index)
Replies the line at the specified index.- Parameters:
index
- the index.- Returns:
- BusLine
- Throws:
IndexOutOfBoundsException
- in case of error.
-
getBusLine
@Pure public BusLine getBusLine(String name)
Replies the bus line with the specified name.- Parameters:
name
- is the desired name- Returns:
- BusLine or
null
-
getBusLine
@Pure public BusLine getBusLine(UUID uuid)
Replies the bus line with the specified uuid.- Parameters:
uuid
- the identifier.- Returns:
- BusLine or
null
-
getBusLine
@Pure public BusLine getBusLine(String name, Comparator<String> nameComparator)
Replies the bus line with the specified name.- Parameters:
name
- is the desired namenameComparator
- is used to compare the names.- Returns:
- BusLine or
null
-
busLineIterator
@Pure public Iterator<BusLine> busLineIterator()
Replies the list of the bus lines of the bus network.- Returns:
- a list of bus lines
-
busLines
@Pure public Iterable<BusLine> busLines()
Replies the list of the bus lines of the bus network.- Returns:
- a list of bus lines
-
addBusStop
public boolean addBusStop(BusStop busStop)
Add a bus stop inside the bus network.- Parameters:
busStop
- is the bus stop to insert.- Returns:
true
if the bus stop was added, otherwisefalse
-
removeAllBusStops
public void removeAllBusStops()
Remove all the bus stops from the current network.
-
removeBusStop
public boolean removeBusStop(BusStop busStop)
Remove a bus stop from this network. If this bus stop removal implies empty hubs, these hubs will be also removed.- Parameters:
busStop
- is the bus stop to remove.- Returns:
true
if the bus stop was successfully removed, otherwisefalse
-
removeBusStop
public boolean removeBusStop(String name)
Remove the bus stops with the given name. If this bus stop removal implies empty hubs, these hubs will be also removed.- Parameters:
name
- is the name of the bus stop to remove.- Returns:
true
if the bus stop was successfully removed, otherwisefalse
-
getBusStopCount
@Pure public int getBusStopCount()
Replies the count of bus stops into this network.- Returns:
- the count of bus stops into this network.
-
getBusStop
@Pure public BusStop getBusStop(String name)
Replies the bus stop with the specified name.- Parameters:
name
- is the desired name- Returns:
- BusStop or
null
-
getBusStop
@Pure public BusStop getBusStop(UUID id)
Replies the bus stop with the specified id.- Parameters:
id
- is the desired identifier- Returns:
- BusStop or
null
-
getBusStop
@Pure public BusStop getBusStop(String name, Comparator<String> nameComparator)
Replies the bus stop with the specified name.- Parameters:
name
- is the desired namenameComparator
- is used to compare the names.- Returns:
- BusStop or
null
-
busStopIterator
@Pure public Iterator<BusStop> busStopIterator()
Replies the list of the bus stops of the bus network.- Returns:
- a list of bus stops
-
busStops
@Pure public Iterable<BusStop> busStops()
Replies the list of the bus stops of the bus network.- Returns:
- a list of bus stops
-
getBusStopsIn
@Pure public Iterator<BusStop> getBusStopsIn(Rectangle2afp<?,?,?,?,?,?> clipBounds)
Replies the set of bus stops that have an intersection with the specified rectangle.This function replies the bus stops with a broad-first iteration on the elements' tree.
- Parameters:
clipBounds
- is the bounds outside which the bus stops will not be replied- Returns:
- the bus stops inside the specified bounds.
-
getNearestBusStop
@Pure public final BusStop getNearestBusStop(Point2D<?,?> point)
Replies the nearest bus stop to the given point.- Parameters:
point
- the point.- Returns:
- the nearest bus stop or
null
if none was found.
-
getNearestBusStop
@Pure public final BusStop getNearestBusStop(GeoLocationPoint point)
Replies the nearest bus stop to the given point.- Parameters:
point
- the point- Returns:
- the nearest bus stop or
null
if none was found.
-
getNearestBusStop
@Pure public BusStop getNearestBusStop(double x, double y)
Replies the nearest bus stops to the given point.- Parameters:
x
- x coordinate.y
- y coordinate.- Returns:
- the nearest bus stop or
null
if none was found.
-
addBusHub
public BusHub addBusHub(BusStop... stops)
Add a bus hub in this network. At least, one bus stop must be given to create a hub. The name of the hub is deduced from the bus stops names.- Parameters:
stops
- are the bus stops to put inside the hub.- Returns:
- the create bus hub, or
null
if not created.
-
addBusHub
public BusHub addBusHub(String name, BusStop... stops)
Add a bus hub in this network. At least, one bus stop must be given to create a hub if you pass anull
name.- Parameters:
name
- is the name of the hub.stops
- are the bus stops to put inside the hub.- Returns:
- the create bus hub, or
null
if not created.
-
removeAllBusHubs
public void removeAllBusHubs()
Remove all the bus hubs from the current network.
-
removeBusHub
public boolean removeBusHub(BusHub busHub)
Remove a bus hubs from this network.- Parameters:
busHub
- is the bus hub to remove.- Returns:
true
if the bus hub was successfully removed, otherwisefalse
-
removeBusHub
public boolean removeBusHub(String name)
Remove the bus hub with the given name.- Parameters:
name
- is the name of the bus hub to remove.- Returns:
true
if the bus hub was successfully removed, otherwisefalse
-
getBusHubCount
@Pure public int getBusHubCount()
Replies the count of bus hubs into this network.- Returns:
- the count of bus hubs into this network.
-
getBusHub
@Pure public BusHub getBusHub(String name)
Replies the bus hub with the specified name.- Parameters:
name
- is the desired name- Returns:
- a bus hub or
null
-
getBusHub
@Pure public BusHub getBusHub(UUID uuid)
Replies the bus hub with the specified uuid.- Parameters:
uuid
- the identifier.- Returns:
- a bus hub or
null
-
getBusHub
@Pure public BusHub getBusHub(String name, Comparator<String> nameComparator)
Replies the bus hub with the specified name.- Parameters:
name
- is the desired namenameComparator
- is used to compare the names.- Returns:
- a bus hub or
null
-
busHubIterator
@Pure public Iterator<BusHub> busHubIterator()
Replies the list of the bus hubs of the bus network.- Returns:
- a list of bus hubs.
-
busHubs
@Pure public Iterable<BusHub> busHubs()
Replies the list of the bus hubs of the bus network.- Returns:
- a list of bus hubs
-
getBusHubsIn
@Pure public Iterator<BusHub> getBusHubsIn(Rectangle2afp<?,?,?,?,?,?> clipBounds)
Replies the set of bus hubs that have an intersection with the specified rectangle.This function replies the bus hubs with a broad-first iteration on the hubs' tree.
- Parameters:
clipBounds
- is the bounds outside which the bus hubs will not be replied- Returns:
- the bus hubs inside the specified bounds.
-
getNearestBusHub
@Pure public final BusHub getNearestBusHub(Point2D<?,?> point)
Replies the nearest bus hub to the given point.- Parameters:
point
- the point- Returns:
- the nearest bus hub or
null
if none was found.
-
getNearestBusHub
@Pure public final BusHub getNearestBusHub(GeoLocationPoint point)
Replies the nearest bus hub to the given point.- Parameters:
point
- the point- Returns:
- the nearest bus hub or
null
if none was found.
-
getNearestBusHub
@Pure public BusHub getNearestBusHub(double x, double y)
Replies the nearest bus hub to the given point.- Parameters:
x
- x coordinate.y
- y coordinate.- Returns:
- the nearest bus hub or
null
if none was found.
-
onBusPrimitiveChanged
public void onBusPrimitiveChanged(BusChangeEvent event)
Description copied from interface:BusChangeListener
Invoked each time the bus primitive changed (excepts for graphical attributes).- Specified by:
onBusPrimitiveChanged
in interfaceBusChangeListener
- Overrides:
onBusPrimitiveChanged
in classAbstractBusContainer<BusContainer<?>,BusLine>
- Parameters:
event
- the event.
-
-