saker.util Documentation TaskDoc JavaDoc Packages
package saker.util
public final class ConcatIterator<Timplements Iterator<T>
Iterator that concatenates other iterators.

This class takes an iterator of iterators during its construction, and will iterate over them after each other.

The iterator supports removals only if the iterator that returned the last element supports it.

TThe element type.
Constructors
public
ConcatIterator(Iterator<extends Iterator<extends T>> iterators)
Creates a new instance.
Methods
public boolean
Returns true if the iteration has more elements.
public T
Returns the next element in the iteration.
public void
Removes from the underlying collection the last element returned by this iterator (optional operation).
public ConcatIterator(Iterator<extends Iterator<extends T>> iterators) throws NullPointerException
Creates a new instance.
iteratorsThe iterator of iterators that should be iterated over.
NullPointerExceptionIf the argument is null.
public boolean hasNext()
Overridden from: Iterator
Returns true if the iteration has more elements. (In other words, returns true if Iterator.next() would return an element rather than throwing an exception.)
true if the iteration has more elements
public T next()
Overridden from: Iterator
Returns the next element in the iteration.
the next element in the iteration
public void remove()
Overridden from: Iterator
Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to Iterator.next(). The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.