|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--structure.AbstractIterator
|
+--structure.GraphListEIterator
An iterator over all edges. Every directed/undirected edge is considered exactly once. Order is not guaranteed.
Typical use:
Graph g = new GraphList();
// ...list gets built up...
Iterator ei = g.edges();
while (ei.hasNext())
{
System.out.println(ei.next());
}
| Field Summary | |
protected java.util.Iterator |
edges
|
| Constructor Summary | |
GraphListEIterator(Map dict)
|
|
| Method Summary | |
java.lang.Object |
get()
Returns the value currently being considered by the AbstractIterator. |
boolean |
hasNext()
Returns true if the iterator has more elements to visit. |
java.lang.Object |
next()
Moves, bumps, or "increments" the iterator along the traversal; returns the next value considered. |
void |
reset()
Reset iterator to the beginning of the structure. |
| Methods inherited from class structure.AbstractIterator |
hasMoreElements, nextElement, remove, value |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Iterator edges
| Constructor Detail |
public GraphListEIterator(Map dict)
dict - | Method Detail |
public void reset()
AbstractIteratorIterator or
Enumeration implementation, but some traversals
may allow efficient multi-pass implementations with little
overhead. The user is encouraged to implement this method.
reset in class AbstractIteratorpublic boolean hasNext()
AbstractIteratorhasMoreElements is an
Enumeration-required call to this method. The user
should override only this method.
hasNext in interface java.util.IteratorhasNext in class AbstractIteratorAbstractIterator.hasMoreElements()public java.lang.Object get()
AbstractIteratorIterator nor
Enumeration. This method should be implemented,
however, to provide better support for for-loops.
get in class AbstractIteratorpublic java.lang.Object next()
AbstractIteratorvalue method.
This method is preferred over the nextElement method.
next in interface java.util.Iteratornext in class AbstractIteratorAbstractIterator.hasMoreElements(),
AbstractIterator.value()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||