public class SimpleGraphPath<V,E> extends Object implements GraphPath<V,E>
SimpleGraph
Constructor and Description |
---|
SimpleGraphPath(SimpleGraph<V,E> simpleGraph,
List<V> vertices,
double weight) |
Modifier and Type | Method and Description |
---|---|
List<E> |
getEdgeList()
Returns the edges making up the path.
|
V |
getEndVertex()
Returns the end vertex in the path.
|
SimpleGraph<V,E> |
getGraph()
Returns the graph over which this path is defined.
|
V |
getStartVertex()
Returns the start vertex in the path.
|
List<V> |
getVertexList() |
double |
getWeight()
Returns the weight assigned to the path.
|
public SimpleGraphPath(SimpleGraph<V,E> simpleGraph, List<V> vertices, double weight)
simpleGraph
- The simple graph where the path is.vertices
- A list of vertices that make up the path.IllegalArgumentException
- if the vertices are not in the path or
if they do not define a path in the graph.public SimpleGraph<V,E> getGraph()
GraphPath
public V getStartVertex()
GraphPath
getStartVertex
in interface GraphPath<V,E>
public V getEndVertex()
GraphPath
getEndVertex
in interface GraphPath<V,E>
public List<E> getEdgeList()
GraphPath
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.
getEdgeList
in interface GraphPath<V,E>
public double getWeight()
GraphPath
Copyright © 2016. All rights reserved.