public class IterationWrapper<E,X extends Exception> extends AbstractCloseableIteration<E,X>
Modifier and Type | Field and Description |
---|---|
protected Iteration<? extends E,? extends X> |
wrappedIter
Deprecated.
This will be changed to private, possibly with an accessor in future. Do not rely on it.
|
Modifier | Constructor and Description |
---|---|
protected |
IterationWrapper(Iteration<? extends E,? extends X> iter)
Creates a new IterationWrapper that operates on the supplied Iteration.
|
Modifier and Type | Method and Description |
---|---|
protected void |
handleClose()
Closes this Iteration and also closes the wrapped Iteration if it is a
CloseableIteration . |
boolean |
hasNext()
Checks whether the wrapped Iteration contains more elements, closing this Iteration when this is not the case.
|
E |
next()
Returns the next element from the wrapped Iteration.
|
void |
remove()
Removes the last element that has been returned from the wrapped Iteration.
|
close, isClosed
@Deprecated protected final Iteration<? extends E,? extends X extends Exception> wrappedIter
public boolean hasNext() throws X extends Exception
public E next() throws X extends Exception
NoSuchElementException
- If all elements have been returned or it has been closed.X extends Exception
public void remove() throws X extends Exception
UnsupportedOperationException
- If the wrapped Iteration does not support the remove operation.IllegalStateException
- if the Iteration has been closed, or if next()
has not yet been
called, or remove()
has already been called after the last call to
next()
.X extends Exception
protected void handleClose() throws X extends Exception
CloseableIteration
.handleClose
in class AbstractCloseableIteration<E,X extends Exception>
X
X extends Exception
Copyright © 2015-2019 Eclipse Foundation. All Rights Reserved.