Textractor API textractor-720 (20091120123250)

textractor.database
Class TextractorDBDocumentSequence

java.lang.Object
  extended by textractor.database.TextractorDBDocumentSequence
All Implemented Interfaces:
DocumentSequence, Closeable
Direct Known Subclasses:
AmbiguityDocumentSequence

public class TextractorDBDocumentSequence
extends Object
implements DocumentSequence

A document sequence that reads documents from the database.

Author:
Fabien Campagne Date: Oct 23, 2005 Time: 12:45:10 PM

Field Summary
protected  int chunkSize
           
protected  DbManager dbm
           
 
Constructor Summary
TextractorDBDocumentSequence(DbManager dbm, DocumentFactory factory, int chunkSize)
          Construct the sequence with a database manager.
TextractorDBDocumentSequence(DbManager dbm, TextractorDocumentFactory factory, int chunkSize, SentenceFilter filter)
          Construct the sequence with a database manager and a sentence filter.
TextractorDBDocumentSequence(DocumentFactory factory, int chunkSize)
          Construct the sequence, creating a new database manager with default connection parameters.
 
Method Summary
 void close()
          Releases database resources.
 DocumentFactory factory()
           
 DocumentIterator iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbm

protected DbManager dbm

chunkSize

protected int chunkSize
Constructor Detail

TextractorDBDocumentSequence

public TextractorDBDocumentSequence(DbManager dbm,
                                    DocumentFactory factory,
                                    int chunkSize)
Construct the sequence with a database manager.

Parameters:
dbm - The database manager to connect to the textractor database
factory - The document factory that should be used to create the documents returned by this sequence.
chunkSize - Number of documents to retrieve from the database in on chunk.

TextractorDBDocumentSequence

public TextractorDBDocumentSequence(DocumentFactory factory,
                                    int chunkSize)
                             throws TextractorDatabaseException
Construct the sequence, creating a new database manager with default connection parameters.

Parameters:
factory - The document factory that should be used to create the documents returned by this sequence.
chunkSize - Number of documents to retrieve from the database in on chunk.
Throws:
TextractorDatabaseException

TextractorDBDocumentSequence

public TextractorDBDocumentSequence(DbManager dbm,
                                    TextractorDocumentFactory factory,
                                    int chunkSize,
                                    SentenceFilter filter)
Construct the sequence with a database manager and a sentence filter. The filter provides a mechanism to restrict the set of documents that the document sequence will return.

Parameters:
dbm - The database manager to connect to the textractor database
factory - The document factory that should be used to create the documents returned by this sequence.
chunkSize - Number of documents to retrieve from the database in on chunk.
filter - A filter to decide which sentences from the database should be returned by this sequence.
Method Detail

iterator

public DocumentIterator iterator()
Specified by:
iterator in interface DocumentSequence

factory

public DocumentFactory factory()
Specified by:
factory in interface DocumentSequence

close

public void close()
Releases database resources. Shutdown the DbManager only if this class created it (the DbManager will not be closed if it was provided by the constructor).

Specified by:
close in interface DocumentSequence
Specified by:
close in interface Closeable

Textractor API textractor-720 (20091120123250)

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