Package org.jgrapht.graph
Class GraphPathImpl<V,E>
- java.lang.Object
-
- org.jgrapht.graph.GraphPathImpl<V,E>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<E>
getEdgeList()
Returns the edges making up the path.V
getEndVertex()
Returns the end vertex in the path.Graph<V,E>
getGraph()
Returns the graph over which this path is defined.V
getStartVertex()
Returns the start vertex in the path.double
getWeight()
Returns the weight assigned to the path.java.lang.String
toString()
-
-
-
Method Detail
-
getGraph
public Graph<V,E> 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
public V 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
public V 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
public java.util.List<E> 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-