Package com.mysema.commons.lang
Class IteratorAdapter<T>
- java.lang.Object
-
- com.mysema.commons.lang.IteratorAdapter<T>
-
- All Implemented Interfaces:
CloseableIterator<T>
,java.io.Closeable
,java.lang.AutoCloseable
,java.util.Iterator<T>
public class IteratorAdapter<T> extends java.lang.Object implements CloseableIterator<T>
Adapter implementation for Iterator and CloseableIterator instances
-
-
Constructor Summary
Constructors Constructor Description IteratorAdapter(java.util.Iterator<T> iter)
IteratorAdapter(java.util.Iterator<T> iter, java.io.Closeable closeable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<T>
asList()
static <T> java.util.List<T>
asList(java.util.Iterator<T> iter)
void
close()
Closes this iterator and releases any system resources associated with it.boolean
hasNext()
T
next()
void
remove()
-
-
-
Field Detail
-
iter
private final java.util.Iterator<T> iter
-
closeable
private final java.io.Closeable closeable
-
-
Method Detail
-
asList
public static <T> java.util.List<T> asList(java.util.Iterator<T> iter)
-
asList
public java.util.List<T> asList()
-
close
public void close()
Description copied from interface:CloseableIterator
Closes this iterator and releases any system resources associated with it. If the iterator is already closed then invoking this method has no effect.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceCloseableIterator<T>
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
-