Class RoadAStar.VirtualSegment
- java.lang.Object
-
- org.arakhne.afc.gis.road.path.astar.RoadAStar.VirtualSegment
-
- All Implemented Interfaces:
Serializable,Cloneable,AttributeCollection,AttributeProvider,FlagContainer,GISFlagContainer,GISPrimitive,RoadSegment,Segment1D<Point2d,Vector2d>,GraphSegment<RoadSegment,RoadConnection>,JsonableObject
- Enclosing class:
- RoadAStar
static class RoadAStar.VirtualSegment extends Object implements RoadSegment
Is a road segment that connects a virtual point to a real road connection.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:55
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisroad
-
-
Field Summary
-
Fields inherited from interface org.arakhne.afc.gis.primitive.FlagContainer
FLAG_READONLY, FLAG_SELECTED
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description VirtualSegment(RoadSegment virtualizedSegment, RoadAStar.VirtualPoint startPoint, RoadConnection endPoint)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttributeChangeListener(AttributeChangeListener listener)Add a listener on the attribute value changes.voidaddAttributes(Map<String,Object> content)Put the values given as parameter in this attribute provider.voidaddAttributes(AttributeProvider content)Put the values given as parameter in this attribute provider.voidaddUserData(String id, Object data)Add an user data associated to this segment.Iterable<Attribute>attributes()Replies all the attributes.voidclearUserData()Clear all the data from all the groups.voidclearUserData(String id)Clear all the data from a group.RoadAStar.VirtualSegmentclone()Make a deep copy of this object and replies the copy.booleancontains(Point2D<?,?> point)Replies if the specified point (x,y) was inside the figure of this MapElement.booleancontains(Point2D<?,?> point, double delta)Replies if the specified point (x,y) was inside the figure of this MapElement.booleancontainsUserData(String id, Object data)Replies if the given one user data is associated to the given identifier.GraphIterator<RoadSegment,RoadConnection>depthIterator(double depth, double positionFromStartingPoint, RoadConnection startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<RoadSegment,RoadConnection> dynamicDepthUpdate)Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point.doubledistance(Point2D<?,?> point)Replies the distance between this MapElement and point.doubledistance(Point2D<?,?> point, double width)Replies the distance between this figure and the specified point.doubledistanceToEnd(Point2D<?,?> point)Replies the distance between the nearest end of this MapElement and the point.doubledistanceToEnd(Point2D<?,?> point, double width)Replies the distance between the nearest end of this MapElement and the point.voidflush()Force this provider to synchronized the memory state of the attributes with a remote storage area.voidfreeMemory()Clean the internal memory-storage structures if they exist.Collection<String>getAllAttributeNames()Replies all the attribute names.Collection<Attribute>getAllAttributes()Replies all the attributes.Map<AttributeType,Collection<Attribute>>getAllAttributesByType()Replies all the attributes sorted by type.Point2dgetAntepenulvianPoint()Replies the coordinates of the antepenulvian (before last) point.AttributeValuegetAttribute(String name)Replies the value for the given attribute.booleangetAttribute(String name, boolean defaultValue)Replies the value for the given attribute.doublegetAttribute(String name, double defaultValue)Replies the value for the given attribute.floatgetAttribute(String name, float defaultValue)Replies the value for the given attribute.intgetAttribute(String name, int defaultValue)Replies the value for the given attribute.longgetAttribute(String name, long defaultValue)Replies the value for the given attribute.Class<?>getAttribute(String name, Class<?> defaultValue)Replies the value for the given attribute.StringgetAttribute(String name, String defaultValue)Replies the value for the given attribute.InetAddressgetAttribute(String name, InetAddress defaultValue)Replies the value for the given attribute.InetAddressgetAttribute(String name, InetSocketAddress defaultValue)Replies the value for the given attribute.URIgetAttribute(String name, URI defaultValue)Replies the value for the given attribute.URLgetAttribute(String name, URL defaultValue)Replies the value for the given attribute.DategetAttribute(String name, Date defaultValue)Replies the value for the given attribute.UUIDgetAttribute(String name, UUID defaultValue)Replies the value for the given attribute.AttributeValuegetAttribute(String name, AttributeValue defaultValue)Replies the value for the given attribute.<T extends Enum<T>>
TgetAttribute(String name, T defaultValue)Replies the value for the given attribute.booleangetAttributeAsBool(String name)Replies the value for the given attribute.DategetAttributeAsDate(String name)Replies the value for the given attribute.doublegetAttributeAsDouble(String name)Replies the value for the given attribute.Enum<?>getAttributeAsEnumeration(String name)Replies the value for the given attribute.<T extends Enum<T>>
TgetAttributeAsEnumeration(String name, Class<T> type)Replies the value for the given attribute.floatgetAttributeAsFloat(String name)Replies the value for the given attribute.InetAddressgetAttributeAsInetAddress(String name)Replies the value for the given attribute.intgetAttributeAsInt(String name)Replies the value for the given attribute.Class<?>getAttributeAsJavaClass(String name)Replies the value for the given attribute.longgetAttributeAsLong(String name)Replies the value for the given attribute.StringgetAttributeAsString(String name)Replies the value for the given attribute.URIgetAttributeAsURI(String name)Replies the value for the given attribute.URLgetAttributeAsURL(String name)Replies the value for the given attribute.UUIDgetAttributeAsUUID(String name)Replies the value for the given attribute.intgetAttributeCount()Replies the count of attributes.AttributegetAttributeObject(String name)Replies the attribute with the given name.RoadConnectiongetBeginPoint()Replies the starting point of this segment.Rectangle2dgetBoundingBox()Replies the bounding box of this element.doublegetDistanceFromStart(double ratio)Replies the distance from the starting point.doublegetDistanceToEnd(double ratio)Replies the distance to the ending point.RoadConnectiongetEndPoint()Replies the ending point of this segment.Point2dgetFirstPoint()Replies the 2D cooordinate of the first point of the segment.intgetFlags()Replies the flags associated to this element.GeoIdgetGeoId()Replies an unique identifier for primitive.GeoLocationgetGeoLocation()Replies the geo-location.Point2dgetGeoLocationForDistance(double desiredDistance)Replies the geo-location of the point described by the specified distance.Point2dgetGeoLocationForDistance(double desiredDistance, double shifting)Replies the geo-location of the point described by the specified distance.voidgetGeoLocationForDistance(double desiredDistance, double shifting, Point2D<?,?> geoLocation)Replies the geo-location of the point described by the specified distance.voidgetGeoLocationForDistance(double desiredDistance, double shifting, Point2D<?,?> geoLocation, Vector2D<?,?> tangent)Replies the geo-location of the point described by the specified distance.Point2dgetGeoLocationForDistance(double desiredDistance, double shifting, Vector2D<?,?> tangent)Replies the geo-location of the point described by the specified distance.voidgetGeoLocationForDistance(double desiredDistance, Point2D<?,?> geoLocation)Replies the geo-location of the point described by the specified distance.Point2dgetGeoLocationForLocationRatio(double ratio)Replies the geo-location of the point described by the location ratio.Point2dgetGeoLocationForLocationRatio(double ratio, double shifting)Replies the geo-location of the point described by the location ratio.voidgetGeoLocationForLocationRatio(double ratio, double shifting, Point2D<?,?> geoLocation)Replies the geo-location of the point described by the location ratio.voidgetGeoLocationForLocationRatio(double ratio, double shifting, Point2D<?,?> geoLocation, Vector2D<?,?> tangent)Replies the geo-location of the point described by the location ratio.Point2dgetGeoLocationForLocationRatio(double ratio, double shifting, Vector2D<?,?> tangent)Replies the geo-location of the point described by the location ratio.voidgetGeoLocationForLocationRatio(double ratio, Point2D<?,?> geoLocation)Replies the geo-location of the point described by the location ratio.doublegetLaneCenter(int laneIndex)Replies the center line of the lane at the given index.intgetLaneCount()Replies the count of lanes on this road segment.Direction1DgetLaneDirection(int laneIndex)Replies the direction of the lane at the given index.doublegetLaneSize(int laneIndex)Replies the size of the lane at the given index.Point2dgetLastPoint()Replies the 2D cooordinates of the last point of the segment.doublegetLength()Returns the road length in the geo-located referencial.StringgetName()Returns the name of the road.Point1dgetNearestPosition(Point2D<?,?> pos, double lateralDistance)Return the nearest point 1.5D from a 2D position.RoadConnectiongetOtherSidePoint(RoadConnection refPoint)Replies the point at the other side of the segment.Point2dgetPointAt(int index)Replies the specified point at the given index.intgetPointCount()Replies the count of points in all the parts.doublegetRoadBorderDistance()Replies the distance to the road border according to the driving side on the road.RoadNetworkgetRoadNetwork()Replies the road network that contains this segment.StringgetRoadNumber()Replies the number of the road segment.RoadTypegetRoadType()Replies the type of the road segment.List<RoadSegment>getSegmentChain()Replies a list of chained road segments without any cross-road which contains this road segment.List<RoadSegment>getSegmentChain(boolean forwardSearch, boolean backwardSearch)Replies a list of chained road segments without any cross-road which contains this road segment.RoadConnectiongetSharedConnectionWith(RoadSegment otherSegment)Replies the shared connection between this segment and the specified one.Vector2dgetTangentAt(double positionOnSegment)Replies the 2D tangent at the position on the segment.TrafficDirectiongetTrafficDirection()Replies the traffic direction on this road segment.<T> TgetUserData(String id)Replies an user data associated to this segment.<T> Collection<? extends T>getUserDataCollection(String id)Replies the user data associated to this segment.UUIDgetUUID()Replies the Unique identifier.RoadSegmentgetVirtualizedSegment()Replies the virtualized segment.doublegetWidth()Returns the road width in the geo-located referencial.RoadSegmentgetWrappedRoadSegment()Replies the wrapped road segment if this object is a wrapper to another road segment.booleanhasAttribute(String name)Replies if the given attribute exists.booleanhasFlag(int flagIndex)Replies if the specified flag is set for this element.booleanhasUserData(String id)Replies if at least one user data is associated to the given identifier.booleanintersects(Shape2D<?,?,?,?,?,? extends Rectangle2afp<?,?,?,?,?,?>> bounds)Replies if this element has an intersection with the specified rectangle.booleanisConnectedTo(RoadSegment otherSegment)Replies if this segment is connected to the specified segment.booleanisEventFirable()Replies if the events are fired by this container.booleanisFirstPointConnectedTo(Segment1D<?,?> otherSegment)Replies if this segment is connected to the specified segment by its first point.booleanisLastPointConnectedTo(Segment1D<?,?> otherSegment)Replies if this segment is connected to the specified segment by its last point.booleanisTraversableFrom(RoadConnection point)Replies if this road segment is traversable from the given point.GraphIterator<RoadSegment,RoadConnection>iterator()Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point.GraphIterator<RoadSegment,RoadConnection>iterator(RoadConnection startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point.Iterator<Point2d>pointIterator()Replies the iterator on the points.Iterable<Point2d>points()Replies the iterator on the points.voidprojectsOnPlane(double positionOnSegment, double shiftDistance, Point2D<?,?> position, Vector2D<?,?> tangent)Replies the 2D position and the 2D tangent at the position on the segment.voidprojectsOnPlane(double positionOnSegment, Point2D<?,?> position, Vector2D<?,?> tangent)Replies the 2D position and the 2D tangent at the position on the segment.booleanremoveAllAttributes()Remove all the attributes.booleanremoveAttribute(String name)Remove the given attribute.voidremoveAttributeChangeListener(AttributeChangeListener listener)Remove a listener on the attribute value changes.booleanremoveUserData(String id, Object data)Remove an user data associated to this segment.booleanrenameAttribute(String oldname, String newname)Rename the attribute.booleanrenameAttribute(String oldname, String newname, boolean overwrite)Rename the attribute .AttributesetAttribute(String name, boolean value)Set the value for the given attribute.AttributesetAttribute(String name, double value)Set the value for the given attribute.AttributesetAttribute(String name, float value)Set the value for the given attribute.AttributesetAttribute(String name, int value)Set the value for the given attribute.AttributesetAttribute(String name, long value)Set the value for the given attribute.AttributesetAttribute(String name, Class<?> value)Set the value for the given attribute.AttributesetAttribute(String name, Enum<?> value)Set the value for the given attribute.AttributesetAttribute(String name, String value)Set the value for the given attribute.AttributesetAttribute(String name, InetAddress value)Set the value for the given attribute.AttributesetAttribute(String name, InetSocketAddress value)Set the value for the given attribute.AttributesetAttribute(String name, URI value)Set the value for the given attribute.AttributesetAttribute(String name, URL value)Set the value for the given attribute.AttributesetAttribute(String name, Date value)Set the value for the given attribute.AttributesetAttribute(String name, UUID value)Set the value for the given attribute.AttributesetAttribute(String name, AttributeValue value)Set the value for the given attribute.AttributesetAttribute(Attribute value)Set the value for the given attribute.voidsetAttributes(Map<String,Object> content)Set the content of this collection from the given map.voidsetAttributes(AttributeProvider content)Set the content of this collection from the given map.AttributesetAttributeType(String name, AttributeType type)Set the type of the attribute with the given name.voidsetEventFirable(boolean isFirable)Set if the events are fired by this container.voidsetFlag(int flag)Set the flag.voidsetName(String name)Set the name of the road.voidsetRoadNumber(String number)Set the number of the road segment.voidsetRoadType(RoadType type)Set the type of the road segment.voidsetTrafficDirection(TrafficDirection direction)Set the traffic direction on this road segment.voidsetUserData(String id, Object data)Set an user data associated to this segment.voidsetWidth(double width)Set the road width in the geo-located referencial.voidswitchFlag(int flagIndex)Switch the value of the specified flag on this element.voidtoJson(JsonBuffer buffer)Replies the Json representation of this node.voidtoMap(Map<String,Object> mapToFill)Fill the given map with the values stored in this attribute provider.voidtoPath2D(Path2d path, double startPosition, double endPosition)Fill the given path with the values representing this road segment.StringtoString()voidunsetFlag(int flagIndex)Unset the flag.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
toMap
-
Methods inherited from interface org.arakhne.afc.gis.road.primitive.RoadSegment
depthIterator, getNearestPosition, getNearestPositionOnBorder, toPath2D, toPath2D, toPath2D
-
-
-
-
Constructor Detail
-
VirtualSegment
VirtualSegment(RoadSegment virtualizedSegment, RoadAStar.VirtualPoint startPoint, RoadConnection endPoint)
Constructor.- Parameters:
virtualizedSegment- the segment to virtualize.startPoint- the start point.endPoint- the end point.
-
-
Method Detail
-
getVirtualizedSegment
public RoadSegment getVirtualizedSegment()
Replies the virtualized segment.- Returns:
- the virtualized segment.
-
clone
public RoadAStar.VirtualSegment clone()
Description copied from interface:AttributeCollectionMake a deep copy of this object and replies the copy.- Specified by:
clonein interfaceAttributeCollection- Specified by:
clonein interfaceAttributeProvider- Specified by:
clonein interfaceRoadSegment- Overrides:
clonein classObject- Returns:
- the deep copy.
-
addUserData
public void addUserData(String id, Object data)
Description copied from interface:RoadSegmentAdd an user data associated to this segment.The user data ar not stored as attributes because they are assumed as transient.
- Specified by:
addUserDatain interfaceRoadSegment- Parameters:
id- is the identifier of the groupdata- is the data to insert in the group
-
clearUserData
public void clearUserData(String id)
Description copied from interface:RoadSegmentClear all the data from a group.The user data ar not stored as attributes because they are assumed as transient.
- Specified by:
clearUserDatain interfaceRoadSegment- Parameters:
id- is the identifier of the group
-
clearUserData
public void clearUserData()
Description copied from interface:RoadSegmentClear all the data from all the groups.The user data ar not stored as attributes because they are assumed as transient.
- Specified by:
clearUserDatain interfaceRoadSegment
-
contains
public boolean contains(Point2D<?,?> point, double delta)
Description copied from interface:RoadSegmentReplies if the specified point (x,y) was inside the figure of this MapElement.- Specified by:
containsin interfaceRoadSegment- Parameters:
point- is a geo-referenced coordinatedelta- is the geo-referenced distance that corresponds to a approximation distance in the screen coordinate system- Returns:
trueif the specified point has a distance nearest than delta to this element, otherwisefalse
-
contains
public boolean contains(Point2D<?,?> point)
Description copied from interface:RoadSegmentReplies if the specified point (x,y) was inside the figure of this MapElement.If this MapElement has no associated figure, this method always returns
false.- Specified by:
containsin interfaceRoadSegment- Parameters:
point- is a geo-referenced coordinate- Returns:
trueif this MapElement had an associated figure and the specified point was inside this bounds of this figure, otherwisefalse
-
containsUserData
public boolean containsUserData(String id, Object data)
Description copied from interface:RoadSegmentReplies if the given one user data is associated to the given identifier.The user data ar not stored as attributes because they are assumed as transient.
- Specified by:
containsUserDatain interfaceRoadSegment- Parameters:
id- is the identifier of the groupdata- is the data to insert in the group- Returns:
trueif the user data exists, otherwisefalse
-
depthIterator
public GraphIterator<RoadSegment,RoadConnection> depthIterator(double depth, double positionFromStartingPoint, RoadConnection startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<RoadSegment,RoadConnection> dynamicDepthUpdate)
Description copied from interface:RoadSegmentReplies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point. If the specified starting point is not one of the ends of th segment, this function assumes to start from the point replied byRoadSegment.getBeginPoint().- Specified by:
depthIteratorin interfaceRoadSegment- Parameters:
depth- is the maximal depth to reach (in meters).positionFromStartingPoint- is the starting position from the starting_point (in meters).startingPoint- is the point from which the iteration must start.allowManyReplies- may betrueto allow to reply many times the same segment, otherwisefalse.assumeOrientedSegments- may betrueto assume that the same segment has two different instances for graph iteration: the first instance is associated the first point of the segment and the second instance is associated to the last point of the segment. If this parameter isfalseto assume that the end points of a segment are not distinguished.dynamicDepthUpdate- if notnull, it is invoked to dynamically update thedepth.- Returns:
- an iterator
- See Also:
RoadSegment.depthIterator(double, double, RoadConnection, boolean, boolean)
-
distance
public double distance(Point2D<?,?> point)
Description copied from interface:RoadSegmentReplies the distance between this MapElement and point.- Specified by:
distancein interfaceRoadSegment- Parameters:
point- a point- Returns:
- the distance. Could be negative depending of the implementation type.
-
distance
public double distance(Point2D<?,?> point, double width)
Description copied from interface:RoadSegmentReplies the distance between this figure and the specified point.- Specified by:
distancein interfaceRoadSegment- Parameters:
point- is the coordinate of the point.width- is the width of the polyline.- Returns:
- the computed distance
-
distanceToEnd
public double distanceToEnd(Point2D<?,?> point)
Description copied from interface:RoadSegmentReplies the distance between the nearest end of this MapElement and the point.- Specified by:
distanceToEndin interfaceRoadSegment- Parameters:
point- a point.- Returns:
- the distance. Should be negative depending of the MapElement type.
-
distanceToEnd
public double distanceToEnd(Point2D<?,?> point, double width)
Description copied from interface:RoadSegmentReplies the distance between the nearest end of this MapElement and the point.- Specified by:
distanceToEndin interfaceRoadSegment- Parameters:
point- is the coordinate of the point.width- is the width of the polyline.- Returns:
- the computed distance
-
getAntepenulvianPoint
public Point2d getAntepenulvianPoint()
Description copied from interface:RoadSegmentReplies the coordinates of the antepenulvian (before last) point.- Specified by:
getAntepenulvianPointin interfaceRoadSegment- Returns:
- the coordinates of the antepenulvian (before last) point.
-
getBoundingBox
public Rectangle2d getBoundingBox()
Description copied from interface:RoadSegmentReplies the bounding box of this element.- Specified by:
getBoundingBoxin interfaceRoadSegment- Returns:
- the bounding box or
nullif not applicable.
-
getDistanceFromStart
public double getDistanceFromStart(double ratio)
Description copied from interface:RoadSegmentReplies the distance from the starting point.- Specified by:
getDistanceFromStartin interfaceRoadSegment- Parameters:
ratio- is the position on the segment.0for the starting point and1for the ending point.- Returns:
- the distance
-
getDistanceToEnd
public double getDistanceToEnd(double ratio)
Description copied from interface:RoadSegmentReplies the distance to the ending point.- Specified by:
getDistanceToEndin interfaceRoadSegment- Parameters:
ratio- is the position on the segment.0for the starting point and1for the ending point.- Returns:
- the distance
-
getEndPoint
public RoadConnection getEndPoint()
Description copied from interface:GraphSegmentReplies the ending point of this segment.- Specified by:
getEndPointin interfaceGraphSegment<RoadSegment,RoadConnection>- Specified by:
getEndPointin interfaceRoadSegment- Returns:
- the ending point of this segment.
-
getFirstPoint
public Point2d getFirstPoint()
Description copied from interface:Segment1DReplies the 2D cooordinate of the first point of the segment.- Specified by:
getFirstPointin interfaceRoadSegment- Specified by:
getFirstPointin interfaceSegment1D<Point2d,Vector2d>- Returns:
- the 2D coordinate or
nullif 2D mapping is impossible.
-
getGeoLocation
public GeoLocation getGeoLocation()
Description copied from interface:GISPrimitiveReplies the geo-location.A GeoLocation is unique according to the geo-location of the element. If two elements have the same points in the same order, or if two elements have the same points in a reverse order, they must have equal GeoLocations.
The following code is always true (where the arguments of the constructors are the list of points of the polyline). It illustrates that for two elements with the same geo-localized points, they have the same geo-location identifier (Geo-Id) and they have different unique ientifier (Uid):
GISElement obj1 = new MapPolyline(100,10,200,30,300,4); GISElement obj2 = new MapPolyline(100,10,200,30,300,4); assert( obj1.getGeoId().equals(obj2.getGeoId()) ); assert( obj2.getGeoId().equals(obj1.getGeoId()) ); assert( ! obj1.getUid().equals(obj2.getUid()) ); assert( ! obj2.getUid().equals(obj1.getUid()) );- Specified by:
getGeoLocationin interfaceGISPrimitive- Specified by:
getGeoLocationin interfaceRoadSegment- Returns:
- a location
- See Also:
GISPrimitive.getGeoId(),GISPrimitive.getGeoLocation()
-
getGeoLocationForDistance
public Point2d getGeoLocationForDistance(double desiredDistance)
Description copied from interface:RoadSegmentReplies the geo-location of the point described by the specified distance. The desired distance is0for the starting point andRoadSegment.getLength()for the ending point.- Specified by:
getGeoLocationForDistancein interfaceRoadSegment- Parameters:
desiredDistance- is the distance for which the geo location must be computed.- Returns:
- the geo-location.
-
getGeoLocationForDistance
public Point2d getGeoLocationForDistance(double desiredDistance, double shifting)
Description copied from interface:RoadSegmentReplies the geo-location of the point described by the specified distance. The desired distance is0for the starting point andRoadSegment.getLength()for the ending point.- Specified by:
getGeoLocationForDistancein interfaceRoadSegment- Parameters:
desiredDistance- is the distance for which the geo location must be computed.shifting- is the shifting distance.- Returns:
- the geo-location.
-
getGeoLocationForDistance
public Point2d getGeoLocationForDistance(double desiredDistance, double shifting, Vector2D<?,?> tangent)
Description copied from interface:RoadSegmentReplies the geo-location of the point described by the specified distance. The desired distance is0for the starting point andRoadSegment.getLength()for the ending point.- Specified by:
getGeoLocationForDistancein interfaceRoadSegment- Parameters:
desiredDistance- is the distance for which the geo location must be computed.shifting- is the shifting distance.tangent- is the vector which will be set by the coordinates of the tangent at the replied point. Ifnullthe tangent will not be computed.- Returns:
- the geo-location.
-
getGeoLocationForDistance
public void getGeoLocationForDistance(double desiredDistance, Point2D<?,?> geoLocation)Description copied from interface:RoadSegmentReplies the geo-location of the point described by the specified distance. The desired distance is0for the starting point andRoadSegment.getLength()for the ending point.- Specified by:
getGeoLocationForDistancein interfaceRoadSegment- Parameters:
desiredDistance- is the distance for which the geo location must be computed.geoLocation- is the point to set with geo-localized coordinates.
-
getGeoLocationForDistance
public void getGeoLocationForDistance(double desiredDistance, double shifting, Point2D<?,?> geoLocation)Description copied from interface:RoadSegmentReplies the geo-location of the point described by the specified distance. The desired distance is0for the starting point andRoadSegment.getLength()for the ending point.- Specified by:
getGeoLocationForDistancein interfaceRoadSegment- Parameters:
desiredDistance- is the distance for which the geo location must be computed.shifting- is the shifting distance.geoLocation- is the point to set with geo-localized coordinates.
-
getGeoLocationForDistance
public void getGeoLocationForDistance(double desiredDistance, double shifting, Point2D<?,?> geoLocation, Vector2D<?,?> tangent)Description copied from interface:RoadSegmentReplies the geo-location of the point described by the specified distance. The desired distance is0for the starting point andRoadSegment.getLength()for the ending point.- Specified by:
getGeoLocationForDistancein interfaceRoadSegment- Parameters:
desiredDistance- is the distance for which the geo location must be computed.shifting- is the shifting distance.geoLocation- is the point to set with geo-localized coordinates.tangent- is the vector which will be set by the coordinates of the tangent at the replied point. Ifnullthe tangent will not be computed.
-
getGeoLocationForLocationRatio
public Point2d getGeoLocationForLocationRatio(double ratio)
Description copied from interface:RoadSegmentReplies the geo-location of the point described by the location ratio. The location ratio is0for the starting point and1for the ending point.- Specified by:
getGeoLocationForLocationRatioin interfaceRoadSegment- Parameters:
ratio- is the location ratio.- Returns:
- the location.
-
getGeoLocationForLocationRatio
public Point2d getGeoLocationForLocationRatio(double ratio, double shifting)
Description copied from interface:RoadSegmentReplies the geo-location of the point described by the location ratio. The location ratio is0for the starting point and1for the ending point.The shifting value depends on the given 2D coordinate system.
- Specified by:
getGeoLocationForLocationRatioin interfaceRoadSegment- Parameters:
ratio- is the location ratio.shifting- is the shifting distance.- Returns:
- the geo-location.
-
getGeoLocationForLocationRatio
public Point2d getGeoLocationForLocationRatio(double ratio, double shifting, Vector2D<?,?> tangent)
Description copied from interface:RoadSegmentReplies the geo-location of the point described by the location ratio. The location ratio is0for the starting point and1for the ending point.- Specified by:
getGeoLocationForLocationRatioin interfaceRoadSegment- Parameters:
ratio- is the location ratio.shifting- is the shifting distance.tangent- is the vector which will be set by the coordinates of the tangent at the replied point. Ifnullthe tangent will not be computed.- Returns:
- the geo-location.
-
getGeoLocationForLocationRatio
public void getGeoLocationForLocationRatio(double ratio, Point2D<?,?> geoLocation)Description copied from interface:RoadSegmentReplies the geo-location of the point described by the location ratio. The location ratio is0for the starting point and1for the ending point.- Specified by:
getGeoLocationForLocationRatioin interfaceRoadSegment- Parameters:
ratio- is the location ratio.geoLocation- is the point to set with geo-localized coordinates.
-
getGeoLocationForLocationRatio
public void getGeoLocationForLocationRatio(double ratio, double shifting, Point2D<?,?> geoLocation)Description copied from interface:RoadSegmentReplies the geo-location of the point described by the location ratio. The location ratio is0for the starting point and1for the ending point.The shifting value depends on the given 2D coordinate system.
- Specified by:
getGeoLocationForLocationRatioin interfaceRoadSegment- Parameters:
ratio- is the location ratio.shifting- is the shifting distance.geoLocation- is the point to set with geo-localized coordinates.
-
getGeoLocationForLocationRatio
public void getGeoLocationForLocationRatio(double ratio, double shifting, Point2D<?,?> geoLocation, Vector2D<?,?> tangent)Description copied from interface:RoadSegmentReplies the geo-location of the point described by the location ratio. The location ratio is0for the starting point and1for the ending point.- Specified by:
getGeoLocationForLocationRatioin interfaceRoadSegment- Parameters:
ratio- is the location ratio.shifting- is the shifting distance.geoLocation- is the point to set with geo-localized coordinates.tangent- is the vector which will be set by the coordinates of the tangent at the replied point. Ifnullthe tangent will not be computed.
-
getLaneCenter
public double getLaneCenter(int laneIndex)
Description copied from interface:RoadSegmentReplies the center line of the lane at the given index.The center is given by the jutting distance from the road segment center to the center of the lane.
The lane order is influence by the side-rule of the road network, which is replied by
RoadNetwork.isLeftSidedTrafficDirection()or byRoadNetwork.isRightSidedTrafficDirection(): if left-sided the left-most lane has index 0, if right-sided the right-most lane has index 0.- Specified by:
getLaneCenterin interfaceRoadSegment- Parameters:
laneIndex- the lane index.- Returns:
- shift distance from the segment's center to the lane center.
-
getLaneCount
public int getLaneCount()
Description copied from interface:RoadSegmentReplies the count of lanes on this road segment.- Specified by:
getLaneCountin interfaceRoadSegment- Returns:
- the count of lanes on this road segment.
-
getLaneDirection
public Direction1D getLaneDirection(int laneIndex)
Description copied from interface:RoadSegmentReplies the direction of the lane at the given index.The lane order is influence by the side-rule of the road network, which is replied by
RoadNetwork.isLeftSidedTrafficDirection()or byRoadNetwork.isRightSidedTrafficDirection(): if left-sided the left-most lane has index 0, if right-sided the right-most lane has index 0.- Specified by:
getLaneDirectionin interfaceRoadSegment- Parameters:
laneIndex- the lane index.- Returns:
- the count of lanes on this road segment.
-
getLaneSize
public double getLaneSize(int laneIndex)
Description copied from interface:RoadSegmentReplies the size of the lane at the given index.The lane order is influence by the side-rule of the road network, which is replied by
RoadNetwork.isLeftSidedTrafficDirection()or byRoadNetwork.isRightSidedTrafficDirection(): if left-sided the left-most lane has index 0, if right-sided the right-most lane has index 0.- Specified by:
getLaneSizein interfaceRoadSegment- Parameters:
laneIndex- the lane index.- Returns:
- the size of the lane in meters
-
getLastPoint
public Point2d getLastPoint()
Description copied from interface:Segment1DReplies the 2D cooordinates of the last point of the segment.- Specified by:
getLastPointin interfaceRoadSegment- Specified by:
getLastPointin interfaceSegment1D<Point2d,Vector2d>- Returns:
- the 2D coordinates or
nullif 2D mapping is impossible.
-
getLength
public double getLength()
Description copied from interface:RoadSegmentReturns the road length in the geo-located referencial. The length is the distance between the first point and the last point of the road.- Specified by:
getLengthin interfaceGraphSegment<RoadSegment,RoadConnection>- Specified by:
getLengthin interfaceRoadSegment- Specified by:
getLengthin interfaceSegment1D<Point2d,Vector2d>- Returns:
- the length of the road in meters.
-
getNearestPosition
public Point1d getNearestPosition(Point2D<?,?> pos, double lateralDistance)
Description copied from interface:RoadSegmentReturn the nearest point 1.5D from a 2D position.- Specified by:
getNearestPositionin interfaceRoadSegment- Parameters:
pos- is the testing position.lateralDistance- the lateral distance to put into the replied point, if any.- Returns:
- the nearest 1.5D position on the road network.
- See Also:
RoadSegment.getNearestPosition(Point2D)
-
getOtherSidePoint
public RoadConnection getOtherSidePoint(RoadConnection refPoint)
Description copied from interface:GraphSegmentReplies the point at the other side of the segment.- Specified by:
getOtherSidePointin interfaceGraphSegment<RoadSegment,RoadConnection>- Specified by:
getOtherSidePointin interfaceRoadSegment- Parameters:
refPoint- the reference point.- Returns:
- the point at the other side of the segment.
-
getPointAt
public Point2d getPointAt(int index)
Description copied from interface:RoadSegmentReplies the specified point at the given index.If the index is negative, it will corresponds to an index starting from the end of the list.
- Specified by:
getPointAtin interfaceRoadSegment- Parameters:
index- is the index of the desired point- Returns:
- the point at the given index
-
getPointCount
public int getPointCount()
Description copied from interface:RoadSegmentReplies the count of points in all the parts.- Specified by:
getPointCountin interfaceRoadSegment- Returns:
- the count of points
-
getRoadNetwork
public RoadNetwork getRoadNetwork()
Description copied from interface:RoadSegmentReplies the road network that contains this segment.- Specified by:
getRoadNetworkin interfaceRoadSegment- Returns:
- the road network that contains this segment.
-
getSegmentChain
public List<RoadSegment> getSegmentChain()
Description copied from interface:RoadSegmentReplies a list of chained road segments without any cross-road which contains this road segment.- Specified by:
getSegmentChainin interfaceRoadSegment- Returns:
- a list of road segments.
-
getSegmentChain
public List<RoadSegment> getSegmentChain(boolean forwardSearch, boolean backwardSearch)
Description copied from interface:RoadSegmentReplies a list of chained road segments without any cross-road which contains this road segment.- Specified by:
getSegmentChainin interfaceRoadSegment- Parameters:
forwardSearch- must betrueto search the chain's segments in the forward direction for this road segment.backwardSearch- must betrueto search the chain's segments in the backward direction for this road segment.- Returns:
- a list of road segments.
-
getSharedConnectionWith
public RoadConnection getSharedConnectionWith(RoadSegment otherSegment)
Description copied from interface:RoadSegmentReplies the shared connection between this segment and the specified one.- Specified by:
getSharedConnectionWithin interfaceRoadSegment- Parameters:
otherSegment- a segment.- Returns:
- a shared connection if the two segments are connected, otherwise
null
-
getBeginPoint
public RoadConnection getBeginPoint()
Description copied from interface:GraphSegmentReplies the starting point of this segment.- Specified by:
getBeginPointin interfaceGraphSegment<RoadSegment,RoadConnection>- Specified by:
getBeginPointin interfaceRoadSegment- Returns:
- the starting point of this segment.
-
getTrafficDirection
public TrafficDirection getTrafficDirection()
Description copied from interface:RoadSegmentReplies the traffic direction on this road segment.- Specified by:
getTrafficDirectionin interfaceRoadSegment- Returns:
- the traffic direction
-
getRoadType
public RoadType getRoadType()
Description copied from interface:RoadSegmentReplies the type of the road segment.- Specified by:
getRoadTypein interfaceRoadSegment- Returns:
- the type of the road segment.
-
setRoadType
public void setRoadType(RoadType type)
Description copied from interface:RoadSegmentSet the type of the road segment.- Specified by:
setRoadTypein interfaceRoadSegment- Parameters:
type- is the type of the road segment.
-
getUserData
public <T> T getUserData(String id)
Description copied from interface:RoadSegmentReplies an user data associated to this segment.The user data are not stored as attributes because they are assumed as transient.
- Specified by:
getUserDatain interfaceRoadSegment- Type Parameters:
T- is the type of the data to reply- Parameters:
id- is the identifier of the group- Returns:
- the first data in the group or
null.
-
getUserDataCollection
public <T> Collection<? extends T> getUserDataCollection(String id)
Description copied from interface:RoadSegmentReplies the user data associated to this segment.The user data are not stored as attributes because they are assumed as transient.
- Specified by:
getUserDataCollectionin interfaceRoadSegment- Type Parameters:
T- is the type of the data to reply- Parameters:
id- is the identifier of the group- Returns:
- the list of the user data in the group, never
null.
-
getWidth
public double getWidth()
Description copied from interface:RoadSegmentReturns the road width in the geo-located referencial. The width is the distance between the border lines of the road.- Specified by:
getWidthin interfaceRoadSegment- Returns:
- the width of the road in meters.
-
getRoadBorderDistance
public double getRoadBorderDistance()
Description copied from interface:RoadSegmentReplies the distance to the road border according to the driving side on the road.This function is similar to calls to
{@link #getWidth()} / 2but with a big difference: the previous expression is always positive, the value returned bygetRoadBorderDistance()has a positive or negative sign depending on theside where cars are running.- Specified by:
getRoadBorderDistancein interfaceRoadSegment- Returns:
- shift distance from the segment's center to the road border.
-
setWidth
public void setWidth(double width)
Description copied from interface:RoadSegmentSet the road width in the geo-located referencial. The width is the distance between the border lines of the road.- Specified by:
setWidthin interfaceRoadSegment- Parameters:
width- is the width of the road in meters.
-
getName
public String getName()
Description copied from interface:RoadSegmentReturns the name of the road.- Specified by:
getNamein interfaceRoadSegment- Returns:
- the name of the road.
-
setName
public void setName(String name)
Description copied from interface:RoadSegmentSet the name of the road.- Specified by:
setNamein interfaceRoadSegment- Parameters:
name- is the name of the road.
-
getWrappedRoadSegment
public RoadSegment getWrappedRoadSegment()
Description copied from interface:RoadSegmentReplies the wrapped road segment if this object is a wrapper to another road segment. If this object is not a wrapper to another road segment, relies this object iteself.- Specified by:
getWrappedRoadSegmentin interfaceRoadSegment- Returns:
- the wrapped road segment or this road segment itself.
-
hasUserData
public boolean hasUserData(String id)
Description copied from interface:RoadSegmentReplies if at least one user data is associated to the given identifier.The user data ar not stored as attributes because they are assumed as transient.
- Specified by:
hasUserDatain interfaceRoadSegment- Parameters:
id- is the identifier of the group- Returns:
trueif one user data exists, otherwisefalse
-
intersects
public boolean intersects(Shape2D<?,?,?,?,?,? extends Rectangle2afp<?,?,?,?,?,?>> bounds)
Description copied from interface:RoadSegmentReplies if this element has an intersection with the specified rectangle.If this MapElement has no associated figure, this method always returns
false.- Specified by:
intersectsin interfaceRoadSegment- Parameters:
bounds- the bounds.s- Returns:
trueif this MapElement has an associated figure and the specified rectangle intersecting the figure, otherwisefalse
-
isConnectedTo
public boolean isConnectedTo(RoadSegment otherSegment)
Description copied from interface:RoadSegmentReplies if this segment is connected to the specified segment.- Specified by:
isConnectedToin interfaceRoadSegment- Parameters:
otherSegment- a segment.- Returns:
trueif this segment is connected to the given one, otherwisefalse
-
isTraversableFrom
public boolean isTraversableFrom(RoadConnection point)
Description copied from interface:RoadSegmentReplies if this road segment is traversable from the given point.If the given point is not the start point nor the end point, then this function replies
false.- Specified by:
isTraversableFromin interfaceRoadSegment- Parameters:
point- a point.- Returns:
trueif this segment is traversable starting from the given point; otherwisefalse.
-
iterator
public GraphIterator<RoadSegment,RoadConnection> iterator(RoadConnection startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Description copied from interface:RoadSegmentReplies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point. If the specified starting point is not one of the ends of th segment, this function assumes to start from the point replied byRoadSegment.getBeginPoint().- Specified by:
iteratorin interfaceRoadSegment- Parameters:
startingPoint- is the point from which the iteration must start.allowManyReplies- istrueto allow cycles during iterations, otherwisefalseassumeOrientedSegments- indicates if the iterator is taking into account the orientation of the road segments. Iftrueit assumes that a segment could be reached by both its end points. Iffalseit assumes that a segment could be reach only one time. This parameter is used only when allowManyReplies was set totrue.- Returns:
- an iterator
-
iterator
public GraphIterator<RoadSegment,RoadConnection> iterator()
Description copied from interface:RoadSegmentReplies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point. This function assumes to start from the point replied byRoadSegment.getBeginPoint(). This function does not allow the cycles during the iterations.- Specified by:
iteratorin interfaceRoadSegment- Returns:
- an iterator
-
pointIterator
public Iterator<Point2d> pointIterator()
Description copied from interface:RoadSegmentReplies the iterator on the points.- Specified by:
pointIteratorin interfaceRoadSegment- Returns:
- the iterator on the points.
-
points
public Iterable<Point2d> points()
Description copied from interface:RoadSegmentReplies the iterator on the points.- Specified by:
pointsin interfaceRoadSegment- Returns:
- the iterator on the points.
-
removeUserData
public boolean removeUserData(String id, Object data)
Description copied from interface:RoadSegmentRemove an user data associated to this segment.The user data ar not stored as attributes because they are assumed as transient.
- Specified by:
removeUserDatain interfaceRoadSegment- Parameters:
id- is the identifier of the groupdata- is the data to remove from the group- Returns:
trueif the data was removed, otherwisefalse.
-
setTrafficDirection
public void setTrafficDirection(TrafficDirection direction)
Description copied from interface:RoadSegmentSet the traffic direction on this road segment.- Specified by:
setTrafficDirectionin interfaceRoadSegment- Parameters:
direction- is the new traffic direction. Ifnull, the default traffic direction will be set.
-
setUserData
public void setUserData(String id, Object data)
Description copied from interface:RoadSegmentSet an user data associated to this segment.The user data ar not stored as attributes because they are assumed as transient.
- Specified by:
setUserDatain interfaceRoadSegment- Parameters:
id- is the identifier of the groupdata- is the data to insert in the group
-
addAttributeChangeListener
public void addAttributeChangeListener(AttributeChangeListener listener)
Description copied from interface:AttributeCollectionAdd a listener on the attribute value changes.- Specified by:
addAttributeChangeListenerin interfaceAttributeCollection- Parameters:
listener- the listener.
-
flush
public void flush()
Description copied from interface:AttributeCollectionForce this provider to synchronized the memory state of the attributes with a remote storage area.- Specified by:
flushin interfaceAttributeCollection
-
removeAllAttributes
public boolean removeAllAttributes()
Description copied from interface:AttributeCollectionRemove all the attributes.- Specified by:
removeAllAttributesin interfaceAttributeCollection- Returns:
falseif something wrong appends
-
removeAttribute
public boolean removeAttribute(String name)
Description copied from interface:AttributeCollectionRemove the given attribute.- Specified by:
removeAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to remove.- Returns:
trueon success, otherwhisefalse
-
removeAttributeChangeListener
public void removeAttributeChangeListener(AttributeChangeListener listener)
Description copied from interface:AttributeCollectionRemove a listener on the attribute value changes.- Specified by:
removeAttributeChangeListenerin interfaceAttributeCollection- Parameters:
listener- the listener.
-
renameAttribute
public boolean renameAttribute(String oldname, String newname)
Description copied from interface:AttributeCollectionRename the attribute.If a attribute named
newnamealready exists, this function will replyfalse.This function is equivalent to
renameAttribute(oldname, newname, false).- Specified by:
renameAttributein interfaceAttributeCollection- Parameters:
oldname- is the name of the attribute to rename.newname- is the new name of the attribute.- Returns:
falseif something wrong appends
-
renameAttribute
public boolean renameAttribute(String oldname, String newname, boolean overwrite)
Description copied from interface:AttributeCollectionRename the attribute .- Specified by:
renameAttributein interfaceAttributeCollection- Parameters:
oldname- is the name of the attribute to rename.newname- is the new name of the attribute.overwrite- must betrueif the value of an existing attribute named bynewnamemust be overwritten by the value of the attribute namedoldname.- Returns:
falseif something wrong appends
-
setAttribute
public Attribute setAttribute(Attribute value) throws AttributeException
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
value- is the value to store.- Returns:
- the changed attribute or
null - Throws:
AttributeException- on error.
-
setAttribute
public Attribute setAttribute(String name, InetAddress value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, InetSocketAddress value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, Enum<?> value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, Class<?> value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, AttributeValue value) throws AttributeException
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null - Throws:
AttributeException- on error.
-
setAttribute
public Attribute setAttribute(String name, boolean value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, int value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, long value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, float value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, double value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, String value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, UUID value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, URL value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, URI value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
setAttribute
public Attribute setAttribute(String name, Date value)
Description copied from interface:AttributeCollectionSet the value for the given attribute.- Specified by:
setAttributein interfaceAttributeCollection- Parameters:
name- is the name of the attribute to set.value- is the value to store.- Returns:
- the changed attribute or
null
-
attributes
public Iterable<Attribute> attributes()
Description copied from interface:AttributeProviderReplies all the attributes.- Specified by:
attributesin interfaceAttributeProvider- Returns:
- an iterable object that contains the attributes.
-
freeMemory
public void freeMemory()
Description copied from interface:AttributeProviderClean the internal memory-storage structures if they exist.This function permits to limit the memory usage without removing the attribute value from a hard storage area (database, files...). The attribute which are freed by this method could be reloaded in memory with a call to a getting method.
- Specified by:
freeMemoryin interfaceAttributeProvider
-
getAllAttributeNames
public Collection<String> getAllAttributeNames()
Description copied from interface:AttributeProviderReplies all the attribute names. This function never load the attribute values even if they are not inside the storage layer.- Specified by:
getAllAttributeNamesin interfaceAttributeProvider- Returns:
- the list of all attribute names.
-
getAllAttributes
public Collection<Attribute> getAllAttributes()
Description copied from interface:AttributeProviderReplies all the attributes.- Specified by:
getAllAttributesin interfaceAttributeProvider- Returns:
- the list of all attributes
-
getAllAttributesByType
public Map<AttributeType,Collection<Attribute>> getAllAttributesByType()
Description copied from interface:AttributeProviderReplies all the attributes sorted by type.The keys of the returned hashtable are the types and the values are array of attributes (
Vector).- Specified by:
getAllAttributesByTypein interfaceAttributeProvider- Returns:
- the attributes grouped by type.
-
getAttribute
public AttributeValue getAttribute(String name)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value or
null
-
getAttribute
public URI getAttribute(String name, URI defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public Date getAttribute(String name, Date defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public boolean getAttribute(String name, boolean defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public Class<?> getAttribute(String name, Class<?> defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public InetAddress getAttribute(String name, InetAddress defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public InetAddress getAttribute(String name, InetSocketAddress defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public <T extends Enum<T>> T getAttribute(String name, T defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Type Parameters:
T- is the type of the enumeration.- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public double getAttribute(String name, double defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public float getAttribute(String name, float defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public int getAttribute(String name, int defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public long getAttribute(String name, long defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public String getAttribute(String name, String defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public UUID getAttribute(String name, UUID defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public URL getAttribute(String name, URL defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value
-
getAttribute
public AttributeValue getAttribute(String name, AttributeValue defaultValue)
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributein interfaceAttributeProvider- Parameters:
name- the name.defaultValue- is the default value replied if the attribute has no value.- Returns:
- the value or
null
-
getAttributeAsBool
public boolean getAttributeAsBool(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsBoolin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsDouble
public double getAttributeAsDouble(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsDoublein interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsFloat
public float getAttributeAsFloat(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsFloatin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsInt
public int getAttributeAsInt(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsIntin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsLong
public long getAttributeAsLong(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsLongin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsString
public String getAttributeAsString(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsStringin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsUUID
public UUID getAttributeAsUUID(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsUUIDin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsURL
public URL getAttributeAsURL(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsURLin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsURI
public URI getAttributeAsURI(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsURIin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsDate
public Date getAttributeAsDate(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsDatein interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeCount
public int getAttributeCount()
Description copied from interface:AttributeProviderReplies the count of attributes.- Specified by:
getAttributeCountin interfaceAttributeProvider- Returns:
- the count of attributes.
-
getAttributeObject
public Attribute getAttributeObject(String name)
Description copied from interface:AttributeProviderReplies the attribute with the given name.- Specified by:
getAttributeObjectin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the attribute or
null
-
hasAttribute
public boolean hasAttribute(String name)
Description copied from interface:AttributeProviderReplies if the given attribute exists.- Specified by:
hasAttributein interfaceAttributeProvider- Parameters:
name- the name.- Returns:
trueis an attribute with the given name exists, otherwisefalse
-
getGeoId
public GeoId getGeoId()
Description copied from interface:GISPrimitiveReplies an unique identifier for primitive.A Geo-Id is unique according to the geo-location of the element. If two elements have the same points in the same order, or if two elements have the same points in a reverse order, they must have the same Geo-Id.
- Specified by:
getGeoIdin interfaceGISPrimitive- Returns:
- an identifier
- See Also:
GISPrimitive.getGeoLocation()
-
getUUID
public UUID getUUID()
Description copied from interface:GISPrimitiveReplies the Unique identifier.- Specified by:
getUUIDin interfaceGISPrimitive- Specified by:
getUUIDin interfaceRoadSegment- Returns:
- the Unique identifier, never
null.
-
getFlags
public int getFlags()
Description copied from interface:FlagContainerReplies the flags associated to this element.The flag could be predefined (eg.
FlagContainer.FLAG_SELECTED, or user defined.- Specified by:
getFlagsin interfaceFlagContainer- Returns:
- the flags
- See Also:
FlagContainer.FLAG_SELECTED,FlagContainer.hasFlag(int),FlagContainer.setFlag(int),FlagContainer.unsetFlag(int)
-
hasFlag
public boolean hasFlag(int flagIndex)
Description copied from interface:FlagContainerReplies if the specified flag is set for this element.The flag could be predefined (eg.
FlagContainer.FLAG_SELECTED, or user defined.- Specified by:
hasFlagin interfaceFlagContainer- Parameters:
flagIndex- is the index of the flag- Returns:
trueif the flag was set, otherwisefalse- See Also:
FlagContainer.FLAG_SELECTED,FlagContainer.getFlags(),FlagContainer.setFlag(int),FlagContainer.unsetFlag(int)
-
setFlag
public void setFlag(int flag)
Description copied from interface:FlagContainerSet the flag.The flag could be predefined (eg.
FlagContainer.FLAG_SELECTED, or user defined.- Specified by:
setFlagin interfaceFlagContainer- Parameters:
flag- is the index of the flag- See Also:
FlagContainer.FLAG_SELECTED,FlagContainer.getFlags(),FlagContainer.hasFlag(int),FlagContainer.unsetFlag(int)
-
switchFlag
public void switchFlag(int flagIndex)
Description copied from interface:FlagContainerSwitch the value of the specified flag on this element.The flag could be predefined (eg.
FlagContainer.FLAG_SELECTED, or user defined.- Specified by:
switchFlagin interfaceFlagContainer- Parameters:
flagIndex- is the index of the flag- See Also:
FlagContainer.FLAG_SELECTED,FlagContainer.getFlags(),FlagContainer.setFlag(int),FlagContainer.unsetFlag(int)
-
unsetFlag
public void unsetFlag(int flagIndex)
Description copied from interface:FlagContainerUnset the flag.The flag could be predefined (eg.
FlagContainer.FLAG_SELECTED, or user defined.- Specified by:
unsetFlagin interfaceFlagContainer- Parameters:
flagIndex- is the index of the flag- See Also:
FlagContainer.FLAG_SELECTED,FlagContainer.getFlags(),FlagContainer.hasFlag(int),FlagContainer.setFlag(int)
-
getTangentAt
public Vector2d getTangentAt(double positionOnSegment)
Description copied from interface:Segment1DReplies the 2D tangent at the position on the segment.- Specified by:
getTangentAtin interfaceSegment1D<Point2d,Vector2d>- Parameters:
positionOnSegment- is the position on the segment (in0..length).- Returns:
- the 2D tangent at the position on the segment.
-
isFirstPointConnectedTo
public boolean isFirstPointConnectedTo(Segment1D<?,?> otherSegment)
Description copied from interface:Segment1DReplies if this segment is connected to the specified segment by its first point.- Specified by:
isFirstPointConnectedToin interfaceSegment1D<Point2d,Vector2d>- Parameters:
otherSegment- is the segment to match.- Returns:
trueif this segment is connected to the given one, otherwisefalse.
-
isLastPointConnectedTo
public boolean isLastPointConnectedTo(Segment1D<?,?> otherSegment)
Description copied from interface:Segment1DReplies if this segment is connected to the specified segment by its last point.- Specified by:
isLastPointConnectedToin interfaceSegment1D<Point2d,Vector2d>- Parameters:
otherSegment- is the segment to match.- Returns:
trueif this segment is connected to the given one, otherwisefalse.
-
setAttributeType
public Attribute setAttributeType(String name, AttributeType type) throws AttributeException
Description copied from interface:AttributeCollectionSet the type of the attribute with the given name.- Specified by:
setAttributeTypein interfaceAttributeCollection- Parameters:
name- is the name of the attributetype- is the desired type.- Returns:
- the changed attribute or
null - Throws:
AttributeException- on error.
-
getRoadNumber
public String getRoadNumber()
Description copied from interface:RoadSegmentReplies the number of the road segment.- Specified by:
getRoadNumberin interfaceRoadSegment- Returns:
- the number of the road segment.
-
setRoadNumber
public void setRoadNumber(String number)
Description copied from interface:RoadSegmentSet the number of the road segment.- Specified by:
setRoadNumberin interfaceRoadSegment- Parameters:
number- is the number of the road segment.
-
getAttributeAsEnumeration
public Enum<?> getAttributeAsEnumeration(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsEnumerationin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsEnumeration
public <T extends Enum<T>> T getAttributeAsEnumeration(String name, Class<T> type) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsEnumerationin interfaceAttributeProvider- Type Parameters:
T- is the type of the enumeration to retreive.- Parameters:
name- the name.type- is the type of the enumeration to retreive.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsJavaClass
public Class<?> getAttributeAsJavaClass(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsJavaClassin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
getAttributeAsInetAddress
public InetAddress getAttributeAsInetAddress(String name) throws AttributeException
Description copied from interface:AttributeProviderReplies the value for the given attribute.- Specified by:
getAttributeAsInetAddressin interfaceAttributeProvider- Parameters:
name- the name.- Returns:
- the value
- Throws:
AttributeException- if the attribute was never set.
-
isEventFirable
public boolean isEventFirable()
Description copied from interface:AttributeCollectionReplies if the events are fired by this container.- Specified by:
isEventFirablein interfaceAttributeCollection- Returns:
trueif the events are fired; otherwisefalseif events are not fired.
-
setEventFirable
public void setEventFirable(boolean isFirable)
Description copied from interface:AttributeCollectionSet if the events are fired by this container.- Specified by:
setEventFirablein interfaceAttributeCollection- Parameters:
isFirable- istrueif the events are fired; otherwisefalseif events are not fired.
-
setAttributes
public void setAttributes(Map<String,Object> content)
Description copied from interface:AttributeCollectionSet the content of this collection from the given map. Any previous content of this attribute collection will be lost. This function is equivalent to:this.removeAllAttributes(); this.addAttributes(content);- Specified by:
setAttributesin interfaceAttributeCollection- Parameters:
content- is the content.- See Also:
AttributeCollection.addAttributes(Map)
-
setAttributes
public void setAttributes(AttributeProvider content) throws AttributeException
Description copied from interface:AttributeCollectionSet the content of this collection from the given map. Any previous content of this attribute collection will be lost. This function is equivalent to:this.removeAllAttributes(); this.addAttributes(content);- Specified by:
setAttributesin interfaceAttributeCollection- Parameters:
content- is the content.- Throws:
AttributeException- if one attribute from the content cannot be inserted.- See Also:
AttributeCollection.addAttributes(AttributeProvider)
-
addAttributes
public void addAttributes(Map<String,Object> content)
Description copied from interface:AttributeCollectionPut the values given as parameter in this attribute provider. Any previous content of this attribute collection will remain if the keys are not inside the given content. If the values from the given content will be used to overwrite any existing value.- Specified by:
addAttributesin interfaceAttributeCollection- Parameters:
content- is the content to add inside.- See Also:
AttributeCollection.setAttributes(Map)
-
addAttributes
public void addAttributes(AttributeProvider content) throws AttributeException
Description copied from interface:AttributeCollectionPut the values given as parameter in this attribute provider. Any previous content of this attribute collection will remain if the keys are not inside the given content. If the values from the given content will be used to overwrite any existing value.- Specified by:
addAttributesin interfaceAttributeCollection- Parameters:
content- is the content to add inside.- Throws:
AttributeException- if one attribute from the content cannot be inserted.- See Also:
AttributeCollection.addAttributes(AttributeProvider)
-
toMap
public void toMap(Map<String,Object> mapToFill)
Description copied from interface:AttributeProviderFill the given map with the values stored in this attribute provider.- Specified by:
toMapin interfaceAttributeProvider- Parameters:
mapToFill- is the map to fill, nevernull.
-
projectsOnPlane
public void projectsOnPlane(double positionOnSegment, Point2D<?,?> position, Vector2D<?,?> tangent)Description copied from interface:Segment1DReplies the 2D position and the 2D tangent at the position on the segment.- Specified by:
projectsOnPlanein interfaceSegment1D<Point2d,Vector2d>- Parameters:
positionOnSegment- is the position on the segment (in0..length).position- is the position to fill.tangent- is the tangent to the segment at the given position.
-
projectsOnPlane
public void projectsOnPlane(double positionOnSegment, double shiftDistance, Point2D<?,?> position, Vector2D<?,?> tangent)Description copied from interface:Segment1DReplies the 2D position and the 2D tangent at the position on the segment.- Specified by:
projectsOnPlanein interfaceSegment1D<Point2d,Vector2d>- Parameters:
positionOnSegment- is the position on the segment (in0..length).shiftDistance- is the distance that permits to shift the position from the segment.position- is the position to fill.tangent- is the tangent to the segment at the given position.
-
toPath2D
public void toPath2D(Path2d path, double startPosition, double endPosition)
Description copied from interface:RoadSegmentFill the given path with the values representing this road segment.- Specified by:
toPath2Din interfaceRoadSegment- Parameters:
path- the path to fill out.startPosition- the position along the segment at which the path representation should start. IfDouble.NaNor negative, the path starts at the beginning of the road segment.endPosition- the position along the segment at which the path representation should end. IfDouble.NaNor greater than the segment length, the path ends at the end of the road segment.
-
toJson
public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObjectReplies the Json representation of this node.- Specified by:
toJsonin interfaceJsonableObject- Parameters:
buffer- the Json buffer.
-
-