|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gshute.util.NestedIterator
A NestedIterator consists of an outer iterator for a set of objects, each of which can provide an inner iterator for a set of objects. The iteration sequence for the nested iterator is the concatenation, in outer iteration sequence order, of the iteration sequences of all of the inner iterators. The constructor for a nested iterator specifies the outer iterator and an iterator converter. The iterator converter determines the inner iterator for each of the objects in the outer iteration sequence.
Field Summary | |
protected java.util.Iterator |
currentInnerIterator
currentInnerIterator is the current inner iterator. |
protected static IteratorConverter |
defaultConverter
|
protected IteratorConverter |
iteratorConverter
iteratorConverter generates the inner iterators. |
protected java.util.Iterator |
lastInnerIterator
lastInnerIterator is the inner iterator used in the last next() message. |
protected java.util.Iterator |
outerIterator
outerIterator is the outer iterator. |
Constructor Summary | |
NestedIterator(java.util.Collection c)
new NestedIterator(c) returns a new nested iterator whose outer iterator is a default iterator for c. |
|
NestedIterator(java.util.Collection c,
IteratorConverter icvtr)
new NestedIterator(c, icvtr) returns a new nested iterator whose outer iterator is a default iterator for c. |
|
NestedIterator(java.util.Iterator iter)
new NestedIterator(iter) returns a new nested iterator with outer iterator iter. |
|
NestedIterator(java.util.Iterator iter,
IteratorConverter icvtr)
new NestedIterator(iter, icvtr) returns a new nested iterator with outer iterator iter. |
Method Summary | |
boolean |
hasNext()
iter.hasNext() returns true if there is another object in iter. |
java.lang.Object |
next()
iter.next() returns the next object in iter and advances iter. |
void |
remove()
iter.remove() removes the last object returned by iter.next() from its underlying collection. |
protected void |
validate()
validate() advances the outer iterator for this nested iterator while the inner iterator is exhausted and the outer iterator is not exhausted. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.util.Iterator outerIterator
protected IteratorConverter iteratorConverter
protected java.util.Iterator currentInnerIterator
protected java.util.Iterator lastInnerIterator
protected static IteratorConverter defaultConverter
Constructor Detail |
public NestedIterator(java.util.Collection c)
public NestedIterator(java.util.Collection c, IteratorConverter icvtr)
public NestedIterator(java.util.Iterator iter)
public NestedIterator(java.util.Iterator iter, IteratorConverter icvtr)
Method Detail |
public boolean hasNext()
public java.lang.Object next()
public void remove()
protected void validate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |