Package org.jgrapht.graph
Class GraphPathImpl<V,E>
java.lang.Object
org.jgrapht.graph.GraphPathImpl<V,E>
- All Implemented Interfaces:
GraphPath<V,
E>
GraphPathImpl is a default implementation of
GraphPath
.- Version:
- $Id: GraphPathImpl.java 689 2009-07-04 06:40:29Z perfecthash $
- Author:
- John Sichi
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GraphPathImpl
-
-
Method Details
-
getGraph
Description copied from interface:GraphPath
Returns the graph over which this path is defined. The path may also be valid with respect to other graphs. -
getStartVertex
Description copied from interface:GraphPath
Returns the start vertex in the path.- Specified by:
getStartVertex
in interfaceGraphPath<V,
E> - Returns:
- the start vertex
-
getEndVertex
Description copied from interface:GraphPath
Returns the end vertex in the path.- Specified by:
getEndVertex
in interfaceGraphPath<V,
E> - Returns:
- the end vertex
-
getEdgeList
Description copied from interface:GraphPath
Returns the edges making up the path. The first edge in this path is incident to the start vertex. The last edge is incident to the end vertex. The vertices along the path can be obtained by traversing from the start vertex, finding its opposite across the first edge, and then doing the same successively across subsequent edges;Graphs.getPathVertexList(org.jgrapht.GraphPath<V, E>)
provides a convenience method for this.Whether or not the returned edge list is modifiable depends on the path implementation.
- Specified by:
getEdgeList
in interfaceGraphPath<V,
E> - Returns:
- list of edges traversed by the path
-
getWeight
public double getWeight()Description copied from interface:GraphPath
Returns the weight assigned to the path. Typically, this will be the sum of the weights of the edge list entries (as defined by the containing graph), but some path implementations may use other definitions. -
toString
-