Class RoadPath

    • Constructor Detail

      • RoadPath

        protected RoadPath​(List<RoadSegment> original)
        Constructor of road path that is backed to the given list.
        Parameters:
        original - the list to be the backend.
        Since:
        16.0
      • RoadPath

        public RoadPath()
        Constructor.
      • RoadPath

        public RoadPath​(RoadSegment segment)
        Constructor.
        Parameters:
        segment - is the segment from which to start.
        Since:
        4.0
      • RoadPath

        public RoadPath​(RoadSegment segment,
                        RoadConnection starting_point)
        Constructor.
        Parameters:
        segment - is the segment from which to start.
        starting_point - is the segment's point indicating the direction.
      • RoadPath

        public RoadPath​(RoadPath path)
        Constructor.
        Parameters:
        path - is the path to copy.
        Since:
        4.0
    • Method Detail

      • addPathToPath

        public static boolean addPathToPath​(RoadPath inside,
                                            RoadPath elements)
        Add the elements stored inside a road path into a road path. This function takes care about the two ends to the path to insert into.
        Parameters:
        inside - is the path to change.
        elements - are the elements to insert.
        Returns:
        true if all the elements were added; otherwise false.
        Since:
        4.0
      • of

        public static RoadPath of​(List<RoadSegment> original)
        Create a road path that is backed to the given list.
        Parameters:
        original - the backend list.
        Returns:
        the road path.
        Since:
        16.0
      • getSegmentDirectionAt

        @Pure
        public Direction1D getSegmentDirectionAt​(int index)
        Replies the direction of this path on the road segment at the given index.
        Parameters:
        index - is the index of the road segment.
        Returns:
        the direction of the segment at the given index for this path.
        Since:
        4.0
      • getConnectableSegmentToFirstPoint

        @Pure
        public RoadSegment getConnectableSegmentToFirstPoint​(RoadPath path)
        Replies if the road segment of path (the first or the last in this order) that could be connected to the first point of the current path.
        Parameters:
        path - is the path from which a road segment should be read.
        Returns:
        the connectable segment from the path; or null if no connection is possible.
        Since:
        4.0
      • getConnectableSegmentToLastPoint

        @Pure
        public RoadSegment getConnectableSegmentToLastPoint​(RoadPath path)
        Replies if the road segment of path (the first or the last in this order) that could be connected to the last point of the current path.
        Parameters:
        path - is the path from which a road segment should be read.
        Returns:
        the connectable segment from the path; or null if no connection is possible.
        Since:
        4.0
      • isFirstPointConnectableTo

        @Pure
        public boolean isFirstPointConnectableTo​(RoadPath path)
        Replies if the given road path is connectable to the first point of this road path.
        Parameters:
        path - a path
        Returns:
        true if the given road path is connectable; otherwise false.
        Since:
        4.0
        See Also:
        isConnectableTo(RoadPath), isLastPointConnectableTo(RoadPath)
      • isLastPointConnectableTo

        @Pure
        public boolean isLastPointConnectableTo​(RoadPath path)
        Replies if the given road path is connectable to the last point of this road path.
        Parameters:
        path - a path.
        Returns:
        true if the given road path is connectable; otherwise false.
        Since:
        4.0
        See Also:
        isConnectableTo(RoadPath), isFirstPointConnectableTo(RoadPath)
      • isCulDeSacWay

        @Pure
        public boolean isCulDeSacWay()
        Replies if the last segment in this path is a real cul-de-sac.

        This function is based on RoadConnection.isReallyCulDeSac() which permits to identify the cul-de-sac ways.

        Returns:
        true if the last ponit in this path was marked as cul-de-sac, otherwise false.
        See Also:
        RoadConnection.isReallyCulDeSac()
      • getFirstCrossRoad

        @Pure
        public RoadConnection getFirstCrossRoad()
        Replies the first cross-road point in the path.
        Returns:
        the cross-road point or null if none.
      • getFirstJunctionPoint

        @Pure
        public CrossRoad getFirstJunctionPoint()
        Replies the first cul-de-sac or cross-road point in the path.
        Returns:
        the cul-de-sac/cross-road point or null if none.
      • crossRoads

        @Pure
        public Iterator<CrossRoad> crossRoads()
        Replies an iterator on the junction points in this path.
        Returns:
        an iterator on the junction points in this path.