Class RoadAStar.VirtualSegment

    • 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.
      • addUserData

        public void addUserData​(String id,
                                Object data)
        Description copied from interface: RoadSegment
        Add an user data associated to this segment.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        addUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        data - is the data to insert in the group
      • clearUserData

        public void clearUserData​(String id)
        Description copied from interface: RoadSegment
        Clear all the data from a group.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        clearUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
      • clearUserData

        public void clearUserData()
        Description copied from interface: RoadSegment
        Clear all the data from all the groups.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        clearUserData in interface RoadSegment
      • contains

        public boolean contains​(Point2D<?,​?> point,
                                double delta)
        Description copied from interface: RoadSegment
        Replies if the specified point (x,y) was inside the figure of this MapElement.
        Specified by:
        contains in interface RoadSegment
        Parameters:
        point - is a geo-referenced coordinate
        delta - is the geo-referenced distance that corresponds to a approximation distance in the screen coordinate system
        Returns:
        true if the specified point has a distance nearest than delta to this element, otherwise false
      • contains

        public boolean contains​(Point2D<?,​?> point)
        Description copied from interface: RoadSegment
        Replies 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:
        contains in interface RoadSegment
        Parameters:
        point - is a geo-referenced coordinate
        Returns:
        true if this MapElement had an associated figure and the specified point was inside this bounds of this figure, otherwise false
      • containsUserData

        public boolean containsUserData​(String id,
                                        Object data)
        Description copied from interface: RoadSegment
        Replies 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:
        containsUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        data - is the data to insert in the group
        Returns:
        true if the user data exists, otherwise false
      • depthIterator

        public GraphIterator<RoadSegment,​RoadConnection> depthIterator​(double depth,
                                                                             double positionFromStartingPoint,
                                                                             RoadConnection startingPoint,
                                                                             boolean allowManyReplies,
                                                                             boolean assumeOrientedSegments,
                                                                             DynamicDepthUpdater<RoadSegment,​RoadConnection> dynamicDepthUpdate)
        Description copied from interface: RoadSegment
        Replies 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 by RoadSegment.getBeginPoint().
        Specified by:
        depthIterator in interface RoadSegment
        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 be true to allow to reply many times the same segment, otherwise false.
        assumeOrientedSegments - may be true to 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 is false to assume that the end points of a segment are not distinguished.
        dynamicDepthUpdate - if not null, it is invoked to dynamically update the depth.
        Returns:
        an iterator
        See Also:
        RoadSegment.depthIterator(double, double, RoadConnection, boolean, boolean)
      • distance

        public double distance​(Point2D<?,​?> point)
        Description copied from interface: RoadSegment
        Replies the distance between this MapElement and point.
        Specified by:
        distance in interface RoadSegment
        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: RoadSegment
        Replies the distance between this figure and the specified point.
        Specified by:
        distance in interface RoadSegment
        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: RoadSegment
        Replies the distance between the nearest end of this MapElement and the point.
        Specified by:
        distanceToEnd in interface RoadSegment
        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: RoadSegment
        Replies the distance between the nearest end of this MapElement and the point.
        Specified by:
        distanceToEnd in interface RoadSegment
        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: RoadSegment
        Replies the coordinates of the antepenulvian (before last) point.
        Specified by:
        getAntepenulvianPoint in interface RoadSegment
        Returns:
        the coordinates of the antepenulvian (before last) point.
      • getBoundingBox

        public Rectangle2d getBoundingBox()
        Description copied from interface: RoadSegment
        Replies the bounding box of this element.
        Specified by:
        getBoundingBox in interface RoadSegment
        Returns:
        the bounding box or null if not applicable.
      • getDistanceFromStart

        public double getDistanceFromStart​(double ratio)
        Description copied from interface: RoadSegment
        Replies the distance from the starting point.
        Specified by:
        getDistanceFromStart in interface RoadSegment
        Parameters:
        ratio - is the position on the segment. 0 for the starting point and 1 for the ending point.
        Returns:
        the distance
      • getDistanceToEnd

        public double getDistanceToEnd​(double ratio)
        Description copied from interface: RoadSegment
        Replies the distance to the ending point.
        Specified by:
        getDistanceToEnd in interface RoadSegment
        Parameters:
        ratio - is the position on the segment. 0 for the starting point and 1 for the ending point.
        Returns:
        the distance
      • getGeoLocation

        public GeoLocation getGeoLocation()
        Description copied from interface: GISPrimitive
        Replies 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:
        getGeoLocation in interface GISPrimitive
        Specified by:
        getGeoLocation in interface RoadSegment
        Returns:
        a location
        See Also:
        GISPrimitive.getGeoId(), GISPrimitive.getGeoLocation()
      • getGeoLocationForDistance

        public Point2d getGeoLocationForDistance​(double desiredDistance)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        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: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        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: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        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. If null the tangent will not be computed.
        Returns:
        the geo-location.
      • getGeoLocationForDistance

        public void getGeoLocationForDistance​(double desiredDistance,
                                              Point2D<?,​?> geoLocation)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        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: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        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: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        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. If null the tangent will not be computed.
      • getGeoLocationForLocationRatio

        public Point2d getGeoLocationForLocationRatio​(double ratio)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.
        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        Parameters:
        ratio - is the location ratio.
        Returns:
        the location.
      • getGeoLocationForLocationRatio

        public Point2d getGeoLocationForLocationRatio​(double ratio,
                                                      double shifting)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.

        The shifting value depends on the given 2D coordinate system.

        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        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: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.
        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        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. If null the tangent will not be computed.
        Returns:
        the geo-location.
      • getGeoLocationForLocationRatio

        public void getGeoLocationForLocationRatio​(double ratio,
                                                   Point2D<?,​?> geoLocation)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.
        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        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: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.

        The shifting value depends on the given 2D coordinate system.

        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        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: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.
        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        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. If null the tangent will not be computed.
      • getLaneCenter

        public double getLaneCenter​(int laneIndex)
        Description copied from interface: RoadSegment
        Replies 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 by RoadNetwork.isRightSidedTrafficDirection(): if left-sided the left-most lane has index 0, if right-sided the right-most lane has index 0.

        Specified by:
        getLaneCenter in interface RoadSegment
        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: RoadSegment
        Replies the count of lanes on this road segment.
        Specified by:
        getLaneCount in interface RoadSegment
        Returns:
        the count of lanes on this road segment.
      • getNearestPosition

        public Point1d getNearestPosition​(Point2D<?,​?> pos,
                                          double lateralDistance)
        Description copied from interface: RoadSegment
        Return the nearest point 1.5D from a 2D position.
        Specified by:
        getNearestPosition in interface RoadSegment
        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)
      • getPointAt

        public Point2d getPointAt​(int index)
        Description copied from interface: RoadSegment
        Replies 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:
        getPointAt in interface RoadSegment
        Parameters:
        index - is the index of the desired point
        Returns:
        the point at the given index
      • getPointCount

        public int getPointCount()
        Description copied from interface: RoadSegment
        Replies the count of points in all the parts.
        Specified by:
        getPointCount in interface RoadSegment
        Returns:
        the count of points
      • getRoadNetwork

        public RoadNetwork getRoadNetwork()
        Description copied from interface: RoadSegment
        Replies the road network that contains this segment.
        Specified by:
        getRoadNetwork in interface RoadSegment
        Returns:
        the road network that contains this segment.
      • getSegmentChain

        public List<RoadSegment> getSegmentChain()
        Description copied from interface: RoadSegment
        Replies a list of chained road segments without any cross-road which contains this road segment.
        Specified by:
        getSegmentChain in interface RoadSegment
        Returns:
        a list of road segments.
      • getSegmentChain

        public List<RoadSegment> getSegmentChain​(boolean forwardSearch,
                                                 boolean backwardSearch)
        Description copied from interface: RoadSegment
        Replies a list of chained road segments without any cross-road which contains this road segment.
        Specified by:
        getSegmentChain in interface RoadSegment
        Parameters:
        forwardSearch - must be true to search the chain's segments in the forward direction for this road segment.
        backwardSearch - must be true to 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: RoadSegment
        Replies the shared connection between this segment and the specified one.
        Specified by:
        getSharedConnectionWith in interface RoadSegment
        Parameters:
        otherSegment - a segment.
        Returns:
        a shared connection if the two segments are connected, otherwise null
      • getRoadType

        public RoadType getRoadType()
        Description copied from interface: RoadSegment
        Replies the type of the road segment.
        Specified by:
        getRoadType in interface RoadSegment
        Returns:
        the type of the road segment.
      • setRoadType

        public void setRoadType​(RoadType type)
        Description copied from interface: RoadSegment
        Set the type of the road segment.
        Specified by:
        setRoadType in interface RoadSegment
        Parameters:
        type - is the type of the road segment.
      • getUserData

        public <T> T getUserData​(String id)
        Description copied from interface: RoadSegment
        Replies an user data associated to this segment.

        The user data are not stored as attributes because they are assumed as transient.

        Specified by:
        getUserData in interface RoadSegment
        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: RoadSegment
        Replies the user data associated to this segment.

        The user data are not stored as attributes because they are assumed as transient.

        Specified by:
        getUserDataCollection in interface RoadSegment
        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: RoadSegment
        Returns the road width in the geo-located referencial. The width is the distance between the border lines of the road.
        Specified by:
        getWidth in interface RoadSegment
        Returns:
        the width of the road in meters.
      • getRoadBorderDistance

        public double getRoadBorderDistance()
        Description copied from interface: RoadSegment
        Replies the distance to the road border according to the driving side on the road.

        This function is similar to calls to {@link #getWidth()} / 2 but with a big difference: the previous expression is always positive, the value returned by getRoadBorderDistance() has a positive or negative sign depending on the side where cars are running.

        Specified by:
        getRoadBorderDistance in interface RoadSegment
        Returns:
        shift distance from the segment's center to the road border.
      • setWidth

        public void setWidth​(double width)
        Description copied from interface: RoadSegment
        Set the road width in the geo-located referencial. The width is the distance between the border lines of the road.
        Specified by:
        setWidth in interface RoadSegment
        Parameters:
        width - is the width of the road in meters.
      • getName

        public String getName()
        Description copied from interface: RoadSegment
        Returns the name of the road.
        Specified by:
        getName in interface RoadSegment
        Returns:
        the name of the road.
      • setName

        public void setName​(String name)
        Description copied from interface: RoadSegment
        Set the name of the road.
        Specified by:
        setName in interface RoadSegment
        Parameters:
        name - is the name of the road.
      • getWrappedRoadSegment

        public RoadSegment getWrappedRoadSegment()
        Description copied from interface: RoadSegment
        Replies 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:
        getWrappedRoadSegment in interface RoadSegment
        Returns:
        the wrapped road segment or this road segment itself.
      • hasUserData

        public boolean hasUserData​(String id)
        Description copied from interface: RoadSegment
        Replies 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:
        hasUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        Returns:
        true if one user data exists, otherwise false
      • intersects

        public boolean intersects​(Shape2D<?,​?,​?,​?,​?,​? extends Rectangle2afp<?,​?,​?,​?,​?,​?>> bounds)
        Description copied from interface: RoadSegment
        Replies if this element has an intersection with the specified rectangle.

        If this MapElement has no associated figure, this method always returns false.

        Specified by:
        intersects in interface RoadSegment
        Parameters:
        bounds - the bounds.s
        Returns:
        true if this MapElement has an associated figure and the specified rectangle intersecting the figure, otherwise false
      • isConnectedTo

        public boolean isConnectedTo​(RoadSegment otherSegment)
        Description copied from interface: RoadSegment
        Replies if this segment is connected to the specified segment.
        Specified by:
        isConnectedTo in interface RoadSegment
        Parameters:
        otherSegment - a segment.
        Returns:
        true if this segment is connected to the given one, otherwise false
      • isTraversableFrom

        public boolean isTraversableFrom​(RoadConnection point)
        Description copied from interface: RoadSegment
        Replies 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:
        isTraversableFrom in interface RoadSegment
        Parameters:
        point - a point.
        Returns:
        true if this segment is traversable starting from the given point; otherwise false.
      • iterator

        public GraphIterator<RoadSegment,​RoadConnection> iterator​(RoadConnection startingPoint,
                                                                        boolean allowManyReplies,
                                                                        boolean assumeOrientedSegments)
        Description copied from interface: RoadSegment
        Replies 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 by RoadSegment.getBeginPoint().
        Specified by:
        iterator in interface RoadSegment
        Parameters:
        startingPoint - is the point from which the iteration must start.
        allowManyReplies - is true to allow cycles during iterations, otherwise false
        assumeOrientedSegments - indicates if the iterator is taking into account the orientation of the road segments. If true it assumes that a segment could be reached by both its end points. If false it assumes that a segment could be reach only one time. This parameter is used only when allowManyReplies was set to true.
        Returns:
        an iterator
      • iterator

        public GraphIterator<RoadSegment,​RoadConnection> iterator()
        Description copied from interface: RoadSegment
        Replies 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 by RoadSegment.getBeginPoint(). This function does not allow the cycles during the iterations.
        Specified by:
        iterator in interface RoadSegment
        Returns:
        an iterator
      • removeUserData

        public boolean removeUserData​(String id,
                                      Object data)
        Description copied from interface: RoadSegment
        Remove an user data associated to this segment.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        removeUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        data - is the data to remove from the group
        Returns:
        true if the data was removed, otherwise false.
      • setTrafficDirection

        public void setTrafficDirection​(TrafficDirection direction)
        Description copied from interface: RoadSegment
        Set the traffic direction on this road segment.
        Specified by:
        setTrafficDirection in interface RoadSegment
        Parameters:
        direction - is the new traffic direction. If null, the default traffic direction will be set.
      • setUserData

        public void setUserData​(String id,
                                Object data)
        Description copied from interface: RoadSegment
        Set an user data associated to this segment.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        setUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        data - is the data to insert in the group
      • flush

        public void flush()
        Description copied from interface: AttributeCollection
        Force this provider to synchronized the memory state of the attributes with a remote storage area.
        Specified by:
        flush in interface AttributeCollection
      • removeAttribute

        public boolean removeAttribute​(String name)
        Description copied from interface: AttributeCollection
        Remove the given attribute.
        Specified by:
        removeAttribute in interface AttributeCollection
        Parameters:
        name - is the name of the attribute to remove.
        Returns:
        true on success, otherwhise false
      • renameAttribute

        public boolean renameAttribute​(String oldname,
                                       String newname)
        Description copied from interface: AttributeCollection
        Rename the attribute.

        If a attribute named newname already exists, this function will reply false.

        This function is equivalent to renameAttribute(oldname, newname, false).

        Specified by:
        renameAttribute in interface AttributeCollection
        Parameters:
        oldname - is the name of the attribute to rename.
        newname - is the new name of the attribute.
        Returns:
        false if something wrong appends
      • renameAttribute

        public boolean renameAttribute​(String oldname,
                                       String newname,
                                       boolean overwrite)
        Description copied from interface: AttributeCollection
        Rename the attribute .
        Specified by:
        renameAttribute in interface AttributeCollection
        Parameters:
        oldname - is the name of the attribute to rename.
        newname - is the new name of the attribute.
        overwrite - must be true if the value of an existing attribute named by newname must be overwritten by the value of the attribute named oldname.
        Returns:
        false if something wrong appends
      • setAttribute

        public Attribute setAttribute​(String name,
                                      Enum<?> value)
        Description copied from interface: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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,
                                      boolean value)
        Description copied from interface: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        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: AttributeCollection
        Set the value for the given attribute.
        Specified by:
        setAttribute in interface AttributeCollection
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • freeMemory

        public void freeMemory()
        Description copied from interface: AttributeProvider
        Clean 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:
        freeMemory in interface AttributeProvider
      • getAllAttributeNames

        public Collection<String> getAllAttributeNames()
        Description copied from interface: AttributeProvider
        Replies all the attribute names. This function never load the attribute values even if they are not inside the storage layer.
        Specified by:
        getAllAttributeNames in interface AttributeProvider
        Returns:
        the list of all attribute names.
      • getAttribute

        public URI getAttribute​(String name,
                                URI defaultValue)
        Description copied from interface: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        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: AttributeProvider
        Replies the value for the given attribute.
        Specified by:
        getAttribute in interface AttributeProvider
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • hasAttribute

        public boolean hasAttribute​(String name)
        Description copied from interface: AttributeProvider
        Replies if the given attribute exists.
        Specified by:
        hasAttribute in interface AttributeProvider
        Parameters:
        name - the name.
        Returns:
        true is an attribute with the given name exists, otherwise false
      • getGeoId

        public GeoId getGeoId()
        Description copied from interface: GISPrimitive
        Replies 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:
        getGeoId in interface GISPrimitive
        Returns:
        an identifier
        See Also:
        GISPrimitive.getGeoLocation()
      • getTangentAt

        public Vector2d getTangentAt​(double positionOnSegment)
        Description copied from interface: Segment1D
        Replies the 2D tangent at the position on the segment.
        Specified by:
        getTangentAt in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        positionOnSegment - is the position on the segment (in 0..length).
        Returns:
        the 2D tangent at the position on the segment.
      • isFirstPointConnectedTo

        public boolean isFirstPointConnectedTo​(Segment1D<?,​?> otherSegment)
        Description copied from interface: Segment1D
        Replies if this segment is connected to the specified segment by its first point.
        Specified by:
        isFirstPointConnectedTo in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        otherSegment - is the segment to match.
        Returns:
        true if this segment is connected to the given one, otherwise false.
      • isLastPointConnectedTo

        public boolean isLastPointConnectedTo​(Segment1D<?,​?> otherSegment)
        Description copied from interface: Segment1D
        Replies if this segment is connected to the specified segment by its last point.
        Specified by:
        isLastPointConnectedTo in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        otherSegment - is the segment to match.
        Returns:
        true if this segment is connected to the given one, otherwise false.
      • getRoadNumber

        public String getRoadNumber()
        Description copied from interface: RoadSegment
        Replies the number of the road segment.
        Specified by:
        getRoadNumber in interface RoadSegment
        Returns:
        the number of the road segment.
      • setRoadNumber

        public void setRoadNumber​(String number)
        Description copied from interface: RoadSegment
        Set the number of the road segment.
        Specified by:
        setRoadNumber in interface RoadSegment
        Parameters:
        number - is the number of the road segment.
      • isEventFirable

        public boolean isEventFirable()
        Description copied from interface: AttributeCollection
        Replies if the events are fired by this container.
        Specified by:
        isEventFirable in interface AttributeCollection
        Returns:
        true if the events are fired; otherwise false if events are not fired.
      • setEventFirable

        public void setEventFirable​(boolean isFirable)
        Description copied from interface: AttributeCollection
        Set if the events are fired by this container.
        Specified by:
        setEventFirable in interface AttributeCollection
        Parameters:
        isFirable - is true if the events are fired; otherwise false if events are not fired.
      • addAttributes

        public void addAttributes​(Map<String,​Object> content)
        Description copied from interface: AttributeCollection
        Put 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:
        addAttributes in interface AttributeCollection
        Parameters:
        content - is the content to add inside.
        See Also:
        AttributeCollection.setAttributes(Map)
      • toMap

        public void toMap​(Map<String,​Object> mapToFill)
        Description copied from interface: AttributeProvider
        Fill the given map with the values stored in this attribute provider.
        Specified by:
        toMap in interface AttributeProvider
        Parameters:
        mapToFill - is the map to fill, never null.
      • projectsOnPlane

        public void projectsOnPlane​(double positionOnSegment,
                                    Point2D<?,​?> position,
                                    Vector2D<?,​?> tangent)
        Description copied from interface: Segment1D
        Replies the 2D position and the 2D tangent at the position on the segment.
        Specified by:
        projectsOnPlane in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        positionOnSegment - is the position on the segment (in 0..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: Segment1D
        Replies the 2D position and the 2D tangent at the position on the segment.
        Specified by:
        projectsOnPlane in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        positionOnSegment - is the position on the segment (in 0..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: RoadSegment
        Fill the given path with the values representing this road segment.
        Specified by:
        toPath2D in interface RoadSegment
        Parameters:
        path - the path to fill out.
        startPosition - the position along the segment at which the path representation should start. If Double.NaN or negative, the path starts at the beginning of the road segment.
        endPosition - the position along the segment at which the path representation should end. If Double.NaN or 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: JsonableObject
        Replies the Json representation of this node.
        Specified by:
        toJson in interface JsonableObject
        Parameters:
        buffer - the Json buffer.