|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.mhhe.clrs2e.Kruskal.WeightedEdge
Inner class for weighted edges so that the edges can be sorted and considered in nondecreasing order by weight.
| Field Summary | |
com.mhhe.clrs2e.Vertex |
u
A vertex on which this edge is incident. |
com.mhhe.clrs2e.Vertex |
v
Another vertex on which this edge is incident. |
double |
w
The weight of the edge. |
| Constructor Summary | |
Kruskal.WeightedEdge(com.mhhe.clrs2e.Vertex a,
com.mhhe.clrs2e.Vertex b,
double weight)
Stores the vertices and edge weight into the instance variables. |
|
| Method Summary | |
int |
compareTo(java.lang.Object o)
Compares the weight of this WeightedEdge to
that of another. |
java.lang.String |
toString()
Returns the String representation of this
object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public com.mhhe.clrs2e.Vertex u
public com.mhhe.clrs2e.Vertex v
public double w
| Constructor Detail |
public Kruskal.WeightedEdge(com.mhhe.clrs2e.Vertex a,
com.mhhe.clrs2e.Vertex b,
double weight)
a - One vertex on which this edge is incident.b - Another vertex on which this edge is incident.weight - The weight of the edge.| Method Detail |
public int compareTo(java.lang.Object o)
WeightedEdge to
that of another.
compareTo in interface java.lang.Comparablepublic java.lang.String toString()
String representation of this
object.
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||