|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.util.Iterators.Sequence<E>
E - the type of objects returned by the iteratorIterators.sequence(Iterator,Iterator), Iterators.sequence(Iterator),
or Iterators.sequence(List) instead.
@Deprecated public static class Iterators.Sequence<E>
An Iterators.Sequence iterates over the elements of an
ordered sequence of iterators in turn. Each iterator is exhausted
before moving to the next. These iterators may be supplied as a
pair of iterators, as an array of iterators, or as an iterator of
iterators. The sequence iterator delegates calls to next() and remove() to the relevant iterator in the
underlying sequence of iterators. For next(), this is
the current underlying iterator. For remove(), it's
the last iterator whose next() element was called, and
it throws an illegal state exception if there isn't one.
Implementation Note: Because of the requirements of
Iterator.remove(), a reference to the last iterator is
kept, as well as to the current iterator. Otherwise, the sequence
iterator will release resources as soon as possible. If the
supplied sequence is an array, the elements will not be
automatically returned from that array; it is simply wrapped in an
instance of Iterators.Array.
| Constructor Summary | |
|---|---|
Iterators.Sequence(Iterator<? extends E>[] iterators)
Deprecated. Use the static factory method Iterators.sequence(List) instead. |
|
Iterators.Sequence(Iterator<? extends E> iterator1,
Iterator<? extends E> iterator2)
Deprecated. Use the static factory method Iterators.sequence(Iterator,Iterator) instead. |
|
Iterators.Sequence(Iterator<? extends Iterator<? extends E>> iteratorOfIterators)
Deprecated. Use the static factory method Iterators.sequence(Iterator) instead. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
Deprecated. Returns true if this iterator has another element. |
E |
next()
Deprecated. Return the next element returned by the next iterator in the iterator sequence. |
void |
remove()
Deprecated. Removes the last element returned by this iterator from the collection underlying the iterator from which it was returned. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated
public Iterators.Sequence(Iterator<? extends E> iterator1,
Iterator<? extends E> iterator2)
Iterators.sequence(Iterator,Iterator) instead.
iterator1 - First iterator.iterator2 - Second iterator.@Deprecated public Iterators.Sequence(Iterator<? extends E>[] iterators)
Iterators.sequence(List) instead.
iterators - Sequence of iterators.@Deprecated public Iterators.Sequence(Iterator<? extends Iterator<? extends E>> iteratorOfIterators)
Iterators.sequence(Iterator) instead.
hasNext() and
next() will throw a
ClassCastException.
iteratorOfIterators - Iterator of iterators.| Method Detail |
|---|
public boolean hasNext()
true if this iterator has another element.
This sequence of iterators has another element if it has
another iterator that has another element.
hasNext in interface Iterator<E>true if this sequence of iterators
has another iterator with another element.
ClassCastException - If an object is returned by
the iterator of iterators specified at construction time
that is not an iterator.public E next()
next in interface Iterator<E>ClassCastException - If an object is returned by
the iterator of iterators specified at construction time
that is not an iterator.public void remove()
next().
remove in interface Iterator<E>IllegalStateException - If next() has not
yet been called, or remove() method has
been called after the last call to next().
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||