org.omnaest.utils.structure.iterator
Class ChainedIterator<E>
java.lang.Object
org.omnaest.utils.structure.iterator.ChainedIterator<E>
- Type Parameters:
E -
- All Implemented Interfaces:
- Iterator<E>
public class ChainedIterator<E>
- extends Object
- implements Iterator<E>
A Iterator which is based on a chain of other Iterator instances. All Iterators are traversed in their
order.
The hasNext() will be true as long as at least one remaining Iterator instance returns true for its
Iterator.hasNext() function.
- Author:
- Omnaest
- See Also:
Iterator,
ChainedListIterator
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
iteratorDecoratorSwitchable
protected final IteratorDecoratorSwitchable<E> iteratorDecoratorSwitchable
ChainedIterator
public ChainedIterator(Iterator<E>... iterators)
- Parameters:
iterators - Iterator- See Also:
ChainedIterator
ChainedIterator
public ChainedIterator(Iterable<E>... iterables)
- Parameters:
iterables - Iterable- See Also:
ChainedIterator
hasNext
public boolean hasNext()
- Specified by:
hasNext in interface Iterator<E>
next
public E next()
- Specified by:
next in interface Iterator<E>
remove
public void remove()
- Specified by:
remove in interface Iterator<E>
Copyright © 2013. All Rights Reserved.