org.openjena.atlas.iterator
Class IteratorResourceClosing<T>
java.lang.Object
org.openjena.atlas.iterator.IteratorResourceClosing<T>
- All Implemented Interfaces:
- Iterator<T>, Closeable
public class IteratorResourceClosing<T>
- extends Object
- implements Iterator<T>, Closeable
This iterator will automatically close a Closeable
resource when the iterator is exhausted.
Alternatively, the resource will be closed when close()
is called. An AtlasException
will
be thrown if access is attempted after close()
has been called.
IteratorResourceClosing
public IteratorResourceClosing(Iterator<T> iter,
Closeable resource)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<T>
next
public T next()
- Specified by:
next
in interface Iterator<T>
remove
public void remove()
- Specified by:
remove
in interface Iterator<T>
close
public void close()
- Specified by:
close
in interface Closeable
Licenced under the Apache License, Version 2.0