E
- the type of elements returned by this iterator.public interface IOIterator<E>
Iterator
but throws IOException
.Modifier and Type | Method and Description |
---|---|
static <E> IOIterator<E> |
adapt(java.util.Iterator<E> iterator)
Adapts the given Iterator as an IOIterator.
|
default java.util.Iterator<E> |
asIterator()
Creates an
Iterator for this instance that throws UncheckedIOException instead of
IOException . |
default void |
forEachRemaining(IOConsumer<? super E> action)
Like
Iterator.forEachRemaining(Consumer) . |
boolean |
hasNext()
Like
Iterator.hasNext() . |
E |
next()
Like
Iterator.next() . |
default void |
remove()
Like
Iterator.remove() . |
java.util.Iterator<E> |
unwrap()
Unwraps this instance and returns the underlying
Iterator . |
static <E> IOIterator<E> adapt(java.util.Iterator<E> iterator)
E
- the type of the stream elements.iterator
- The iterator to adaptdefault java.util.Iterator<E> asIterator()
Iterator
for this instance that throws UncheckedIOException
instead of
IOException
.UncheckedIOException
Iterator
.default void forEachRemaining(IOConsumer<? super E> action) throws java.io.IOException
Iterator.forEachRemaining(Consumer)
.action
- See delegate.java.io.IOException
- if an I/O error occurs.boolean hasNext() throws java.io.IOException
Iterator.hasNext()
.java.io.IOException
- if an I/O error occurs.E next() throws java.io.IOException
Iterator.next()
.java.io.IOException
- if an I/O error occurs.java.util.NoSuchElementException
- if the iteration has no more elementsdefault void remove() throws java.io.IOException
Iterator.remove()
.java.io.IOException
- if an I/O error occurs.java.util.Iterator<E> unwrap()
Iterator
.
Implementations may not have anything to unwrap and that behavior is undefined for now.
Copyright © 2010 - 2023 Adobe. All Rights Reserved