Package org.goplanit.utils.path
Interface SimpleDirectedPath
-
- All Superinterfaces:
Iterable<EdgeSegment>
- All Known Subinterfaces:
ManagedDirectedPath
- All Known Implementing Classes:
ManagedDirectedPathImpl
,SimpleDirectedPathImpl
public interface SimpleDirectedPath extends Iterable<EdgeSegment>
Simple Path interface representing a path through the network on edge segment level- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default double
computeLengthKm()
Compute the length in km of the path based on the sum of the edge segment's getLengthKm methodboolean
containsSubPath(Collection<? extends EdgeSegment> subPath)
Verify if the path contains the provided subpath.boolean
containsSubPath(Iterator<? extends EdgeSegment> subPath)
Verify if the path contains the provided subpath.EdgeSegment
getFirstSegment()
Collect first segment on pathEdgeSegment
getLastSegment()
Collect last segment on pathint
hashCode()
hash code for simple directed pathdefault boolean
isEmpty()
verify if the size of the path is zero (empty) or notlong
size()
The size of the path is given by the number of edge segments it holds-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
size
long size()
The size of the path is given by the number of edge segments it holds- Returns:
- size
-
isEmpty
default boolean isEmpty()
verify if the size of the path is zero (empty) or not- Returns:
- true when empty, false otherwise
-
containsSubPath
boolean containsSubPath(Collection<? extends EdgeSegment> subPath)
Verify if the path contains the provided subpath. It is only a subpath of the subpath is present continguously- Parameters:
subPath
- to verify- Returns:
- true when it contains the subpath, false otherwise.
-
containsSubPath
boolean containsSubPath(Iterator<? extends EdgeSegment> subPath)
Verify if the path contains the provided subpath. It is only a subpath of the subpath is present contiguously- Parameters:
subPath
- to verify- Returns:
- true when it contains the subpath, false otherwise.
-
computeLengthKm
default double computeLengthKm()
Compute the length in km of the path based on the sum of the edge segment's getLengthKm method- Returns:
- total length of path in km
-
getFirstSegment
EdgeSegment getFirstSegment()
Collect first segment on path- Returns:
- initial segment
-
getLastSegment
EdgeSegment getLastSegment()
Collect last segment on path- Returns:
- last segment
-
-