Package org.apache.commons.io.function
Interface IOIterator<E>
- Type Parameters:
E- the type of elements returned by this iterator.
public interface IOIterator<E>
Like
Iterator but throws IOException.- Since:
- 2.12.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> IOIterator<E>Adapts the given Iterator as an IOIterator.default voidforEachRemaining(IOConsumer<? super E> action) booleanhasNext()LikeIterator.hasNext().next()LikeIterator.next().default voidremove()LikeIterator.remove().unwrap()Unwraps this instance and returns the underlyingIterator.
-
Method Details
-
adapt
Adapts the given Iterator as an IOIterator.- Type Parameters:
E- the type of the stream elements.- Parameters:
iterator- The iterator to adapt- Returns:
- A new IOIterator
-
asIterator
- Returns:
- an
UncheckedIOExceptionIterator.
-
forEachRemaining
- Parameters:
action- See delegate.- Throws:
IOException- if an I/O error occurs.
-
hasNext
LikeIterator.hasNext().- Returns:
- See delegate.
- Throws:
IOException- if an I/O error occurs.
-
next
LikeIterator.next().- Returns:
- See delegate.
- Throws:
IOException- if an I/O error occurs.NoSuchElementException- if the iteration has no more elements
-
remove
LikeIterator.remove().- Throws:
IOException- if an I/O error occurs.
-
unwrap
Unwraps this instance and returns the underlyingIterator.Implementations may not have anything to unwrap and that behavior is undefined for now.
- Returns:
- the underlying Iterator.
-