public static class GraphUtils.JUNGUtils.GraphPath<E> extends Object implements Comparable<GraphUtils.JUNGUtils.GraphPath>
Class to represent a path in a Graph. Note that a path is defined in terms of edges (rather than vertices) so that multiple edges between the same pair of vertices can be discriminated.
It implements the
interface to impose order between different paths. First, try to order using the path weight, and if equals, using the number of hops.Comparable
Constructor and Description |
---|
GraphUtils.JUNGUtils.GraphPath(List<E> path,
double pathWeight)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(GraphUtils.JUNGUtils.GraphPath o) |
boolean |
equals(Object o) |
List<E> |
getPath()
Returns the edges making up the path.
|
int |
getPathLength()
Returns the path length measured in number of hops or edges.
|
double |
getPathWeight()
Returns the weight assigned to the path.
|
int |
hashCode() |
public GraphUtils.JUNGUtils.GraphPath(List<E> path, double pathWeight)
path
- Sequence of linkspathWeight
- Path weightpublic List<E> getPath()
public int getPathLength()
getPath()
.size()
.public double getPathWeight()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(GraphUtils.JUNGUtils.GraphPath o)
compareTo
in interface Comparable<GraphUtils.JUNGUtils.GraphPath>