Iterator iter = WrappedIterator.create( iter1 ).andThen( iter2 )
WrappedIterator
@Deprecated public class ConcatenatedIterator<T> extends Object implements Iterator<T>
Constructor and Description |
---|
ConcatenatedIterator(Iterator<? extends T> iter0,
Iterator<? extends T> iter1)
Deprecated.
Construct an iterator that is the concatenation of the two
given iterators.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasDefaultValue()
Deprecated.
Answer true if this iteration has a default value.
|
boolean |
hasNext()
Deprecated.
Returns true if the iteration has more elements.
|
T |
next()
Deprecated.
Returns the next element in the interation.
|
void |
remove()
Deprecated.
Removes from the underlying collection the last element returned by
the iterator (optional operation).
|
<X extends T> |
setDefaultValue(X defaultValue)
Deprecated.
Set the default value for this iteration, which will be a value that
is guaranteed to be returned as a member of the iteration.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public ConcatenatedIterator(Iterator<? extends T> iter0, Iterator<? extends T> iter1)
iter0
- The first iterator. Elements of this iterator will appear
first in the elements read from the concatenation.iter1
- The second iterator. Elements of this iterator will appear
second in the elements read from the concatenation.public boolean hasNext()
public T next()
next
in interface Iterator<T>
NoSuchElementException
- - iteration has no more elements.public void remove()
remove
in interface Iterator<T>
UnsupportedOperationException
- - if the remove operation is not
supported by this Iterator.IllegalStateException
- - 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 <X extends T> void setDefaultValue(X defaultValue)
next()
.defaultValue
- The default value for the iteration, or null for
there to be no default value. The default default
value is null.public boolean hasDefaultValue()
Licenced under the Apache License, Version 2.0