java.lang.Object | +--org.apache.commons.collections.iterators.IteratorChainAll Implemented Interfaces:
Iterator | The current iterator |
int | The index of the current iterator |
boolean | ComparatorChain is "locked" after the first time compare(Object,Object) is called |
List | The chain of iterators |
Iterator | The "last used" Iterator is the Iterator upon which next() or hasNext() was most recently called used for the remove() operation only |
Construct an IteratorChain with no Iterators. |
IteratorChain(Iterator iterator) Construct an IteratorChain with a single Iterator. |
IteratorChain(Iterator a, Iterator b) Constructs a new IteratorChain over the two given iterators. |
IteratorChain(Iterator[] iterators) Constructs a new IteratorChain over the array of iterators. |
IteratorChain(Collection iterators) Constructs a new IteratorChain over the collection of iterators. |
void | addIterator(Iterator iterator) Add an Iterator to the end of the chain |
List | Get the list of Iterators (unmodifiable) |
boolean | hasNext() Return true if any Iterator in the IteratorChain has a remaining element. |
boolean | isLocked() Determine if modifications can still be made to the IteratorChain. |
Object | next() Returns the next Object of the current Iterator |
void | remove() Removes from the underlying collection the last element returned by the Iterator. |
void | setIterator(int index, Iterator iterator) Set the Iterator at the given index |
int | size() Number of Iterators in the current IteratorChain. |
void | Updates the current iterator field to ensure that the current Iterator is not exhausted |
protected Iterator currentIterator
protected int currentIteratorIndex
protected boolean isLocked
protected final List iteratorChain
protected Iterator lastUsedIterator
public IteratorChain()
public IteratorChain(Collection iterators)
IteratorChain
over the collection
of iterators.
- if iterators collection is or contains null
- if iterators collection doesn't contain an iteratorpublic IteratorChain(Iterator a, Iterator b)
IteratorChain
over the two
given iterators.
- if either iterator is nullpublic IteratorChain(Iterator iterator)
- if the iterator is nullpublic IteratorChain(Iterator[] iterators)
IteratorChain
over the array
of iterators.
- if iterators array is or contains nullpublic void addIterator(Iterator iterator)
- if I've already started iterating
- if the iterator is nullpublic List getIterators()
public boolean hasNext()
public boolean isLocked()
public Object next()
- if all the Iterators are exhaustedpublic void remove()
- if the remove operator is not supported by the underlying Iterator
- if the next method has not yet been called, or the remove method has
already been called after the last call to the next method.public void setIterator(int index, Iterator iterator)
- if index < 0 or index > size()
- if I've already started iterating
- if the iterator is nullpublic int size()
protected void updateCurrentIterator()