public abstract class ConvertingIteration<S,T,X extends Exception> extends AbstractCloseableIteration<T,X>
Modifier | Constructor and Description |
---|---|
protected |
ConvertingIteration(Iteration<? extends S,? extends X> iter)
Creates a new ConvertingIteration that operates on the supplied source type iteration.
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
convert(S sourceObject)
Converts a source type object to a target type object.
|
protected void |
handleClose()
Closes this iteration as well as the wrapped iteration if it is a
CloseableIteration . |
boolean |
hasNext()
Checks whether the source type iteration contains more elements.
|
T |
next()
Returns the next element from the source type iteration.
|
void |
remove()
Calls remove() on the underlying Iteration.
|
close, isClosed
protected abstract T convert(S sourceObject) throws X extends Exception
public boolean hasNext() throws X extends Exception
public T next() throws X extends Exception
X
NoSuchElementException
- If all elements have been returned.IllegalStateException
- If the iteration 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<T,X extends Exception>
X
X extends Exception
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.