it.unimi.di.mg4j.document
Class AbstractDocumentIterator

java.lang.Object
  extended by it.unimi.di.mg4j.document.AbstractDocumentIterator
All Implemented Interfaces:
DocumentIterator, SafelyCloseable, Closeable
Direct Known Subclasses:
JdbcDocumentCollection.JdbcDocumentIterator

public abstract class AbstractDocumentIterator
extends Object
implements DocumentIterator, SafelyCloseable

An abstract, safely closeable implementation of a document iterator.


Constructor Summary
AbstractDocumentIterator()
           
 
Method Summary
 void close()
          Closes this document iterator, releasing all resources.
protected  void finalize()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unimi.di.mg4j.document.DocumentIterator
nextDocument
 

Constructor Detail

AbstractDocumentIterator

public AbstractDocumentIterator()
Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

close

public void close()
           throws IOException
Description copied from interface: DocumentIterator
Closes this document iterator, releasing all resources.

You should always call this method after having finished with this iterator. Implementations are invited to call this method in a finaliser as a safety net, but since there is no guarantee as to when finalisers are invoked, you should not depend on this behaviour.

Specified by:
close in interface DocumentIterator
Specified by:
close in interface Closeable
Throws:
IOException