efxtools.sample.cpe
Class TextCollectionReader

java.lang.Object
  extended by org.apache.uima.resource.Resource_ImplBase
      extended by org.apache.uima.resource.ConfigurableResource_ImplBase
          extended by org.apache.uima.collection.CollectionReader_ImplBase
              extended by efxtools.sample.cpe.TextCollectionReader
All Implemented Interfaces:
org.apache.uima.collection.base_cpm.BaseCollectionReader, org.apache.uima.collection.CollectionReader, org.apache.uima.resource.ConfigurableResource, org.apache.uima.resource.Resource

public class TextCollectionReader
extends org.apache.uima.collection.CollectionReader_ImplBase

A simple collection reader that reads documents from a directory in the filesystem. It can be configured with the following parameters:

It was not built in the InfexBA project, but is part of the UIMA examples. Some small changes have been applied, though.


Field Summary
static java.lang.String PARAM_ENCODING
          Name of configuration parameter that contains the character encoding used by the input files.
static java.lang.String PARAM_INPUTDIR
          Name of configuration parameter that must be set to the path of a directory containing input files.
static java.lang.String SUFFIX
           
 
Fields inherited from interface org.apache.uima.resource.Resource
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_PARAM_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT
 
Constructor Summary
TextCollectionReader()
           
 
Method Summary
 void close()
           
 void getNext(org.apache.uima.cas.CAS aCAS)
           
 int getNumberOfDocuments()
          Gets the total number of documents that will be returned by this collection reader.
 org.apache.uima.util.Progress[] getProgress()
           
 boolean hasNext()
           
 void initialize()
           
 
Methods inherited from class org.apache.uima.collection.CollectionReader_ImplBase
destroy, getCasInitializer, getProcessingResourceMetaData, initialize, isConsuming, reconfigure, setCasInitializer, typeSystemInit
 
Methods inherited from class org.apache.uima.resource.ConfigurableResource_ImplBase
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue
 
Methods inherited from class org.apache.uima.resource.Resource_ImplBase
getCasManager, getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.uima.resource.ConfigurableResource
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue
 
Methods inherited from interface org.apache.uima.resource.Resource
getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger
 

Field Detail

SUFFIX

public static final java.lang.String SUFFIX
See Also:
Constant Field Values

PARAM_INPUTDIR

public static final java.lang.String PARAM_INPUTDIR
Name of configuration parameter that must be set to the path of a directory containing input files.

See Also:
Constant Field Values

PARAM_ENCODING

public static final java.lang.String PARAM_ENCODING
Name of configuration parameter that contains the character encoding used by the input files. If not specified, the default system encoding will be used.

See Also:
Constant Field Values
Constructor Detail

TextCollectionReader

public TextCollectionReader()
Method Detail

initialize

public void initialize()
                throws org.apache.uima.resource.ResourceInitializationException
Overrides:
initialize in class org.apache.uima.collection.CollectionReader_ImplBase
Throws:
org.apache.uima.resource.ResourceInitializationException
See Also:
CollectionReader_ImplBase.initialize()

hasNext

public boolean hasNext()
See Also:
BaseCollectionReader.hasNext()

getNext

public void getNext(org.apache.uima.cas.CAS aCAS)
             throws java.io.IOException,
                    org.apache.uima.collection.CollectionException
Throws:
java.io.IOException
org.apache.uima.collection.CollectionException
See Also:
CollectionReader.getNext(org.apache.uima.cas.CAS)

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException
See Also:
BaseCollectionReader.close()

getProgress

public org.apache.uima.util.Progress[] getProgress()
See Also:
BaseCollectionReader.getProgress()

getNumberOfDocuments

public int getNumberOfDocuments()
Gets the total number of documents that will be returned by this collection reader. This is not part of the general collection reader interface.

Returns:
the number of documents in the collection