Textractor API textractor-720 (20091120123250)

textractor.mg4j.document
Class TextractorQueueDocumentIterator

java.lang.Object
  extended by textractor.mg4j.document.AbstractTextractorDocumentIterator
      extended by textractor.mg4j.document.TextractorQueueDocumentIterator
All Implemented Interfaces:
DocumentIterator, Closeable

public final class TextractorQueueDocumentIterator
extends AbstractTextractorDocumentIterator


Field Summary
 
Fields inherited from class textractor.mg4j.document.AbstractTextractorDocumentIterator
filteredSentenceCount, sentenceFilter
 
Constructor Summary
TextractorQueueDocumentIterator(DocumentFactory factory, SentenceFilter sentenceFilter, BlockingQueue<Sentence> queue, Semaphore semaphore, int loaderThreadCount)
           
 
Method Summary
 void close()
          Closes this document iterator, releasing all resources.
 Document nextDocument()
          Returns the next document.
 Sentence nextSentence()
          Returns the next textractor document.
 
Methods inherited from class textractor.mg4j.document.AbstractTextractorDocumentIterator
createDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextractorQueueDocumentIterator

public TextractorQueueDocumentIterator(DocumentFactory factory,
                                       SentenceFilter sentenceFilter,
                                       BlockingQueue<Sentence> queue,
                                       Semaphore semaphore,
                                       int loaderThreadCount)
Method Detail

nextDocument

public Document nextDocument()
                      throws IOException
Returns the next document.

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

nextSentence

public Sentence nextSentence()
Returns the next textractor document.

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

close

public void close()
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.


Textractor API textractor-720 (20091120123250)

Copyright © 2003-2008 Institute for Computational Biomedicine, All Rights Reserved.