Package org.geotools.data
Class DefaultCloseableIterator<T>
- Object
-
- DefaultCloseableIterator<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<T>
,CloseableIterator<T>
public class DefaultCloseableIterator<T> extends Object implements CloseableIterator<T>
Default implementation of CloseableIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected Closeable
closeableItem
protected Iterator<T>
wrapped
-
Constructor Summary
Constructors Constructor Description DefaultCloseableIterator(Iterator<T> wrapped)
DefaultCloseableIterator(Iterator<T> wrapped, Closeable closeable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the underlying iterator in case it implementsCloseableIterator
.protected void
finalize()
boolean
hasNext()
T
next()
void
remove()
-
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface Iterator
forEachRemaining
-
-
-
-
Method Detail
-
close
public void close()
Closes the underlying iterator in case it implementsCloseableIterator
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceCloseableIterator<T>
-
-