T - the element's typeX - the type of the exception that may be thrownpublic interface ThrowingIterator<T,X extends java.lang.Exception>
Iterator.Iterator| Modifier and Type | Method and Description |
|---|---|
default void |
forEachRemaining(ThrowingConsumer<? super T,? extends X> action)
Performs the given action for each remaining element until all elements have been processed or the action throws
an exception.
|
boolean |
hasNext()
Returns
true if the iteration has more elements. |
T |
next()
Returns the next element in the iteration.
|
default void |
remove()
Removes from the underlying collection the last element returned by this iterator (optional operation).
|
default void forEachRemaining(ThrowingConsumer<? super T,? extends X> action) throws X extends java.lang.Exception
action - The action to be performed for each elementjava.lang.NullPointerException - if the specified action is nullX - if iteration failsX extends java.lang.ExceptionIterator.forEachRemaining(java.util.function.Consumer)@CheckReturnValue T next() throws java.util.NoSuchElementException, X extends java.lang.Exception
java.util.NoSuchElementException - if the iteration has no more elementsX - if the next element could not be acquiredX extends java.lang.ExceptionIterator.next()@CheckReturnValue
boolean hasNext()
throws X extends java.lang.Exception
true if the iteration has more elements. (In other words, returns true if next()
would return an element rather than throwing an exception.)true if the iteration has more elementsX - if the check for the next value failsX extends java.lang.ExceptionIterator.hasNext()default void remove()
throws X extends java.lang.Exception
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.
The default implementation throws an instance of UnsupportedOperationException and performs no other
action.java.lang.UnsupportedOperationException - if the remove operation is not supported by this iteratorjava.lang.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
methodX - if the remove operations failsX extends java.lang.ExceptionIterator.remove()Copyright © 2015–2018 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.