Class LineReader
java.lang.Object
org.apache.uima.resource.Resource_ImplBase
org.apache.uima.resource.ConfigurableResource_ImplBase
org.apache.uima.collection.CollectionReader_ImplBase
org.apache.uima.fit.component.JCasCollectionReader_ImplBase
org.apache.uima.fit.examples.experiment.pos.LineReader
- All Implemented Interfaces:
BaseCollectionReader
,CollectionReader
,ConfigurableResource
,Resource
This collection reader is meant for example purposes only. For a much more robust and complete
line reader implementation, please see org.cleartk.util.linereader.LineReader.
This collection reader takes a single file and produces one JCas for each line in the file
putting the text of the line into the default view.
-
Field Summary
Fields inherited from interface org.apache.uima.resource.Resource
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_CONFIG_PARAM_SETTINGS, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Subclasses should implement this method rather thanJCasCollectionReader_ImplBase.getNext(CAS)
Progress[]
Gets information about the number of entities and/or amount of data that has been read from thisCollectionReader
, and the total amount that remains (if that information is available).boolean
hasNext()
Gets whether there are any elements remaining to be read from thisCollectionReader
.void
initialize
(UimaContext uimaContext) This method should be overwritten by subclasses.Methods inherited from class org.apache.uima.fit.component.JCasCollectionReader_ImplBase
close, getNext, 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, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, loadUserClass, loadUserClassOrThrow, setContextHolder, setContextHolderX, setLogger, setMetaData, withContextHolder
Methods inherited from class java.lang.Object
clone, equals, finalize, 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 Details
-
PARAM_INPUT_FILE
- See Also:
-
-
Constructor Details
-
LineReader
public LineReader()
-
-
Method Details
-
initialize
Description copied from class:JCasCollectionReader_ImplBase
This method should be overwritten by subclasses.- Overrides:
initialize
in classJCasCollectionReader_ImplBase
- Parameters:
uimaContext
- the UIMA context the component is running in- Throws:
ResourceInitializationException
- if a failure occurs during initialization.
-
hasNext
Description copied from interface:BaseCollectionReader
Gets whether there are any elements remaining to be read from thisCollectionReader
.- Returns:
- true if and only if there are more elements available from this
CollectionReader
. - Throws:
IOException
- if an I/O failure occursCollectionException
- if there is some other problem with reading from the Collection
-
getNext
Description copied from class:JCasCollectionReader_ImplBase
Subclasses should implement this method rather thanJCasCollectionReader_ImplBase.getNext(CAS)
- Specified by:
getNext
in classJCasCollectionReader_ImplBase
- Parameters:
jCas
- theJCas
to store the read data to- Throws:
IOException
- if there was a low-level I/O problemCollectionException
- if there was another problem
-
getProgress
Description copied from interface:BaseCollectionReader
Gets information about the number of entities and/or amount of data that has been read from thisCollectionReader
, and the total amount that remains (if that information is available).This method returns an array of
Progress
objects so that results can be reported using different units. For example, the CollectionReader could report progress in terms of the number of documents that have been read and also in terms of the number of bytes that have been read. In many cases, it will be sufficient to return just oneProgress
object.- Returns:
- an array of
Progress
objects. Each object may have different units (for example number of entities or bytes).
-