Interface ShortestPathResult
-
- All Known Subinterfaces:
MinMaxPathResult
- All Known Implementing Classes:
MinMaxPathResultImpl
,ShortestPathResultImpl
public interface ShortestPathResult
Interfaces that defines how to access results of a shortest path execution allowing one to extract paths or cost information- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DirectedPath
createPath(DirectedPathFactory pathFactory, Vertex origin, Vertex destination)
Create the path from the provided origin to a specified destination vertex, using the results available.default int
forEachBackwardEdgeSegment(Vertex origin, Vertex destination, Consumer<EdgeSegment> backwardEdgeSegmentConsumer)
apply consumer to each edge segment on backward path from destination to origin.double
getCostToReach(Vertex vertex)
Collect the cost to reach the given vertexEdgeSegment
getIncomingEdgeSegmentForVertex(Vertex vertex)
Find the incoming edge segment for a given vertex
-
-
-
Method Detail
-
createPath
DirectedPath createPath(DirectedPathFactory pathFactory, Vertex origin, Vertex destination)
Create the path from the provided origin to a specified destination vertex, using the results available. The path builder is used to create the instance of the path.- Parameters:
pathFactory
- to use for creating path instancesorigin
- the specified origin vertexdestination
- the specified destination vertex- Returns:
- the path that is created, when no path could be extracted null is returned
-
forEachBackwardEdgeSegment
default int forEachBackwardEdgeSegment(Vertex origin, Vertex destination, Consumer<EdgeSegment> backwardEdgeSegmentConsumer)
apply consumer to each edge segment on backward path from destination to origin. If path does not lead to origin, the loop terminates when no backward edge segment is found anymore- Parameters:
origin
- to end loopdestination
- to start backward loopbackwardEdgeSegmentConsumer
- to apply to each segment on the backward path from destination to origin- Returns:
- number of edge segments traversed on the path
-
getIncomingEdgeSegmentForVertex
EdgeSegment getIncomingEdgeSegmentForVertex(Vertex vertex)
Find the incoming edge segment for a given vertex- Parameters:
vertex
- to get incoming segment for- Returns:
- incoming edge segment
-
getCostToReach
double getCostToReach(Vertex vertex)
Collect the cost to reach the given vertex- Parameters:
vertex
- to collect cost for- Returns:
- cost found
-
-