Package org.planit.route
Class RouteImpl
- java.lang.Object
-
- org.planit.route.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 Summary
Constructors Modifier Constructor Description protected
RouteImpl(IdGroupingToken groupId)
Constructorprotected
RouteImpl(IdGroupingToken groupId, List<EdgeSegment> pathEdgeSegments)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
addEdgeSegment(EdgeSegment edgeSegment)
add an edge segment to the path by appending itlong
getId()
Return the id of this pathIterator<EdgeSegment>
getIterator()
Iterator over the available edge segmentsList<EdgeSegment>
getPath()
Return the route as a List of EdgeSegmentsString
toString(RouteIdType pathOutputType)
Outputs this path as a String, appropriate to a specified path output type
-
-
-
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 classpathEdgeSegments
- 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 interfaceRoute
- 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 interfaceRoute
- Returns:
- edgseSegmentIterator
-
getPath
public List<EdgeSegment> getPath()
Return the route as a List of EdgeSegments
-
getId
public long getId()
Return the id of this path
-
toString
public String toString(RouteIdType pathOutputType)
Outputs this path as a String, appropriate to a specified path output type
-
-