Package org.apache.commons.io.function
Class IOIteratorAdapter<E>
- java.lang.Object
-
- org.apache.commons.io.function.IOIteratorAdapter<E>
-
- Type Parameters:
E
- the type of the stream elements.
- All Implemented Interfaces:
IOIterator<E>
final class IOIteratorAdapter<E> extends java.lang.Object implements IOIterator<E>
Adapts anIterator
as anIOIterator
.
-
-
Constructor Summary
Constructors Constructor Description IOIteratorAdapter(java.util.Iterator<E> delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static <E> IOIteratorAdapter<E>
adapt(java.util.Iterator<E> delegate)
Adapts the given Iterator as an IOIterator.boolean
hasNext()
LikeIterator.hasNext()
.E
next()
LikeIterator.next()
.java.util.Iterator<E>
unwrap()
Unwraps this instance and returns the underlyingIterator
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.io.function.IOIterator
asIterator, forEachRemaining, remove
-
-
-
-
Field Detail
-
delegate
private final java.util.Iterator<E> delegate
-
-
Constructor Detail
-
IOIteratorAdapter
IOIteratorAdapter(java.util.Iterator<E> delegate)
-
-
Method Detail
-
adapt
static <E> IOIteratorAdapter<E> adapt(java.util.Iterator<E> delegate)
Description copied from interface:IOIterator
Adapts the given Iterator as an IOIterator.- Type Parameters:
E
- the type of the stream elements.- Parameters:
delegate
- The iterator to adapt- Returns:
- A new IOIterator
-
hasNext
public boolean hasNext() throws java.io.IOException
Description copied from interface:IOIterator
LikeIterator.hasNext()
.- Specified by:
hasNext
in interfaceIOIterator<E>
- Returns:
- See delegate.
- Throws:
java.io.IOException
- if an I/O error occurs.
-
next
public E next() throws java.io.IOException
Description copied from interface:IOIterator
LikeIterator.next()
.- Specified by:
next
in interfaceIOIterator<E>
- Returns:
- See delegate.
- Throws:
java.io.IOException
- if an I/O error occurs.
-
unwrap
public java.util.Iterator<E> unwrap()
Description copied from interface:IOIterator
Unwraps this instance and returns the underlyingIterator
.Implementations may not have anything to unwrap and that behavior is undefined for now.
- Specified by:
unwrap
in interfaceIOIterator<E>
- Returns:
- the underlying Iterator.
-
-