|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.AdjacencyListGraph.Edge | +--com.mhhe.clrs2e.WeightedAdjacencyListGraph.WeightedEdge
Inner class for weighted edges in adjacency lists. Adjacency lists are singly linked.
Field Summary | |
private double |
weight
The weight of this edge. |
Fields inherited from class com.mhhe.clrs2e.AdjacencyListGraph.Edge |
next, vertex |
Constructor Summary | |
WeightedAdjacencyListGraph.WeightedEdge(com.mhhe.clrs2e.Vertex v,
AdjacencyListGraph.Edge successor,
double wgt)
Creates a new edge. |
Method Summary | |
double |
getWeight()
Returns the weight of this edge. |
void |
setWeight(double wgt)
Sets the weight of this edge. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private double weight
Constructor Detail |
public WeightedAdjacencyListGraph.WeightedEdge(com.mhhe.clrs2e.Vertex v, AdjacencyListGraph.Edge successor, double wgt)
v
- The adjacent vertex.successor
- Successor edge to this one.wgt
- The weight of the new edge.Method Detail |
public void setWeight(double wgt)
wgt
- The new weight for this edge.public double getWeight()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |