Class CloseableIterator<T>
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.util.CloseableIterator<T>
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.util.Iterator<T>
public class CloseableIterator<T> extends java.lang.Object implements java.util.Iterator<T>, java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description CloseableIterator(java.util.Iterator<T> iterable, java.io.Closeable closeable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
hasNext()
T
next()
void
remove()
static <T> CloseableIterator<T>
wrap(java.util.Iterator<T> iterator)
static <T> CloseableIterator<T>
wrap(java.util.Iterator<T> iterator, java.io.Closeable closeable)
-
-
-
Constructor Detail
-
CloseableIterator
public CloseableIterator(java.util.Iterator<T> iterable, java.io.Closeable closeable)
-
-
Method Detail
-
wrap
public static <T> CloseableIterator<T> wrap(java.util.Iterator<T> iterator, java.io.Closeable closeable)
-
wrap
public static <T> CloseableIterator<T> wrap(java.util.Iterator<T> iterator)
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
-