public class IlvCompositeIterator<E> extends Object implements Iterator<E>
IlvCompositeIterator
wrappers a collection of existing
iterators into a single traversal sequence. The composite iterator traverses
the elements of each child iterator in their natural sequence.Constructor and Description |
---|
IlvCompositeIterator(Collection<Iterator<E>> iterators)
Creates a new
IlvCompositeIterator from a collection of child
iterators. |
IlvCompositeIterator(Iterator<E>[] iterators)
Creates a new
IlvCompositeIterator from an array of child iterators. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns whether the iteration has more elements.
|
E |
next()
Returns the next element in the iteration.
|
void |
remove()
Removes the last object returned by the iterator from the underlying
collection .
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public IlvCompositeIterator(Iterator<E>[] iterators)
IlvCompositeIterator
from an array of child iterators.public IlvCompositeIterator(Collection<Iterator<E>> iterators)
IlvCompositeIterator
from a collection of child
iterators.public boolean hasNext()
true
if next
would return an element rather than
throwing an exception.public E next()
next
in interface Iterator<E>
NoSuchElementException
- if the iteration has no more elements.public void remove()
next
.
The method is optional and currently throws an unconditional
UnsupportedOperationException
.
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.