it.unimi.dsi.mg4j.document
Class JdbcDocumentCollection.JdbcDocumentIterator

java.lang.Object
  extended by it.unimi.dsi.mg4j.document.AbstractDocumentIterator
      extended by it.unimi.dsi.mg4j.document.JdbcDocumentCollection.JdbcDocumentIterator
All Implemented Interfaces:
SafelyCloseable, DocumentIterator, Closeable
Enclosing class:
JdbcDocumentCollection

protected class JdbcDocumentCollection.JdbcDocumentIterator
extends AbstractDocumentIterator

An iterator over the whole collection that performs a single DBMS transaction.


Method Summary
 void close()
          Closes this document iterator, releasing all resources.
 Document nextDocument()
          Returns the next document.
 
Methods inherited from class it.unimi.dsi.mg4j.document.AbstractDocumentIterator
finalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

nextDocument

public Document nextDocument()
                      throws IOException
Description copied from interface: DocumentIterator
Returns the next document.

Returns:
the next document, or null if there are no other documents.
Throws:
IOException

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
Overrides:
close in class AbstractDocumentIterator
Throws:
IOException