E
- Class type for edgespublic static class GraphUtils.JUNGUtils.GraphPath<E> extends java.lang.Object implements java.lang.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(java.util.List<E> path,
double pathWeight)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(GraphUtils.JUNGUtils.GraphPath o)
Compares this object with the specified object for order.
|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.
|
java.util.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()
Returns a hash code value for the object.
|
public GraphUtils.JUNGUtils.GraphPath(java.util.List<E> path, double pathWeight)
path
- Sequence of linkspathWeight
- Path weightpublic java.util.List<E> getPath()
public int getPathLength()
getPath()
.size()
.public double getPathWeight()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Reference object with which to comparetrue
if this object is the same as the o
argument; false
otherwisepublic int hashCode()
HashMap
.hashCode
in class java.lang.Object
public int compareTo(GraphUtils.JUNGUtils.GraphPath o)
compareTo
in interface java.lang.Comparable<GraphUtils.JUNGUtils.GraphPath>
o
- The object to be compared