|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.mhhe.clrs2e.AdjacencyMatrixGraph.EdgeIterator
|
+--com.mhhe.clrs2e.WeightedAdjacencyMatrixGraph.EdgeIterator
Inner class that overrides
AdjacencyListGraph.EdgeIterator to implement
WeightedEdgeIterator.
| Field Summary |
| Fields inherited from class com.mhhe.clrs2e.AdjacencyMatrixGraph.EdgeIterator |
current, u |
| Constructor Summary | |
WeightedAdjacencyMatrixGraph.EdgeIterator(int v)
Starts an iteration through the weighted edges incident on a given vertex. |
|
| Method Summary | |
double |
getWeight()
Returns the weight of the edge returned by the most recent call to next. |
boolean |
hasNext()
Returns true if this edge iterator has more
edges, false otherwise. |
java.lang.Object |
next()
Returns the next edge in the iteration. |
void |
setWeight(double weight)
Sets the weight of the edge returned by the most recent call to next. |
| Methods inherited from class com.mhhe.clrs2e.AdjacencyMatrixGraph.EdgeIterator |
remove |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Iterator |
remove |
| Constructor Detail |
public WeightedAdjacencyMatrixGraph.EdgeIterator(int v)
v - The index of the vertex.| Method Detail |
public boolean hasNext()
true if this edge iterator has more
edges, false otherwise.
hasNext in interface java.util.IteratorhasNext in class AdjacencyMatrixGraph.EdgeIteratorpublic java.lang.Object next()
next in interface java.util.Iteratornext in class AdjacencyMatrixGraph.EdgeIteratorpublic double getWeight()
next.
getWeight in interface WeightedEdgeIteratorpublic void setWeight(double weight)
next.
setWeight in interface WeightedEdgeIterator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||