Package org.planit.path
Class PathImpl
- java.lang.Object
-
- org.planit.path.PathImpl
-
- All Implemented Interfaces:
Iterable<EdgeSegment>,Path
public class PathImpl extends Object implements Path
This object represents a path based on a number of consecutive LinkSegments 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 Constructor Description PathImpl(IdGroupingToken groupId)ConstructorPathImpl(IdGroupingToken groupId, Deque<EdgeSegment> pathEdgeSegments)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanaddEdgeSegment(EdgeSegment edgeSegment)add an edge segment to the path by appending itlonggetId()Return the id of this pathIterator<EdgeSegment>iterator()StringtoString(PathOutputIdentificationType pathOutputType)Outputs this path as a String, appropriate to a specified path output type-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
PathImpl
public PathImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId- contiguous id generation within this group for instances of this class
-
PathImpl
public PathImpl(IdGroupingToken groupId, Deque<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:
addEdgeSegmentin interfacePath- Parameters:
edgeSegment- the edge segment to add- Returns:
- true as per Collection.add
-
iterator
public Iterator<EdgeSegment> iterator()
- Specified by:
iteratorin interfaceIterable<EdgeSegment>
-
getId
public long getId()
Return the id of this path
-
toString
public String toString(PathOutputIdentificationType pathOutputType)
Outputs this path as a String, appropriate to a specified path output type
-
-