Package org.jgrapht.alg.shortestpath
Class RankingPathElement<V,E>
- java.lang.Object
-
- org.jgrapht.alg.shortestpath.AbstractPathElement<V,E>
-
- org.jgrapht.alg.shortestpath.RankingPathElement<V,E>
-
final class RankingPathElement<V,E> extends AbstractPathElement<V,E>
Helper class forKShortestPaths
.- Since:
- July 5, 2007
-
-
Field Summary
Fields Modifier and Type Field Description private double
weight
Weight of the path.-
Fields inherited from class org.jgrapht.alg.shortestpath.AbstractPathElement
nHops, prevEdge, prevPathElement
-
-
Constructor Summary
Constructors Constructor Description RankingPathElement(Graph<V,E> graph, RankingPathElement<V,E> pathElement, E edge, double weight)
Creates a path element by concatenation of an edge to a path element.RankingPathElement(V vertex)
Creates an empty path element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RankingPathElement<V,E>
getPrevPathElement()
Returns the previous path element.double
getWeight()
Returns the weight of the path.-
Methods inherited from class org.jgrapht.alg.shortestpath.AbstractPathElement
createEdgeListPath, getHopCount, getPrevEdge, getVertex
-
-
-
-
Constructor Detail
-
RankingPathElement
RankingPathElement(Graph<V,E> graph, RankingPathElement<V,E> pathElement, E edge, double weight)
Creates a path element by concatenation of an edge to a path element.- Parameters:
pathElement
-edge
- edge reaching the end vertex of the path element created.weight
- total cost of the created path element.
-
RankingPathElement
RankingPathElement(V vertex)
Creates an empty path element.- Parameters:
vertex
- end vertex of the path element.
-
-
Method Detail
-
getWeight
public double getWeight()
Returns the weight of the path.- Returns:
- .
-
getPrevPathElement
public RankingPathElement<V,E> getPrevPathElement()
Returns the previous path element.- Overrides:
getPrevPathElement
in classAbstractPathElement<V,E>
- Returns:
null
is the path is empty.
-
-