Class RouteImpl

  • All Implemented Interfaces:
    Route

    public class RouteImpl
    extends Object
    implements Route
    This object creates a route of LinkSegment objects to a specified destination using the vertexPathAndCost object created by the (Dijkstra) Shortest Path Algorithm The path creation makes use of the fact that the origin pair will have a null EdgeSegment, so there is no need to specify the origin.
    Author:
    gman6028
    • Constructor Detail

      • RouteImpl

        protected RouteImpl​(IdGroupingToken groupId)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
      • RouteImpl

        protected RouteImpl​(IdGroupingToken groupId,
                            List<EdgeSegment> pathEdgeSegments)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        pathEdgeSegments - the path to set (not copied)
    • Method Detail

      • addEdgeSegment

        public Boolean addEdgeSegment​(EdgeSegment edgeSegment)
        add an edge segment to the path by appending it
        Specified by:
        addEdgeSegment in interface Route
        Parameters:
        edgeSegment - the edge segment to add
        Returns:
        true as per Collection.add
      • getIterator

        public Iterator<EdgeSegment> getIterator()
        Iterator over the available edge segments
        Specified by:
        getIterator in interface Route
        Returns:
        edgseSegmentIterator
      • getPath

        public List<EdgeSegment> getPath()
        Return the route as a List of EdgeSegments
        Specified by:
        getPath in interface Route
        Returns:
        the path as a List of EdgeSegments
      • getId

        public long getId()
        Return the id of this path
        Specified by:
        getId in interface Route
        Returns:
        the id of this path
      • toString

        public String toString​(RouteIdType pathOutputType)
        Outputs this path as a String, appropriate to a specified path output type
        Specified by:
        toString in interface Route
        Parameters:
        pathOutputType - the specified path output type
        Returns:
        String describing the path