Interface BaseCollectionReader
-
- All Superinterfaces:
Resource
- All Known Subinterfaces:
CasDataCollectionReader
,CollectionReader
- All Known Implementing Classes:
CasDataCollectionReader_ImplBase
,CollectionReader_ImplBase
,FileSystemCollectionReader
public interface BaseCollectionReader extends Resource
The BaseCollectionReader
interface. Collection Readers should not implement this interface directly. Instead they should implementCollectionReader
orCasDataCollectionReader
. Most UIMA developers will prefer to use the former.A consuming
CollectionReader
is one that removes each element from the collection as it is read. To find out whether aCollectionReader
will consume elements in this way, call theisConsuming()
method.Users of a
CollectionReader
should alwaysclose
it when they are finished using it.
-
-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes thisCollectionReader
, after which it may no longer be used.ProcessingResourceMetaData
getProcessingResourceMetaData()
Gets the metadata that describes thisCasProcesor
.Progress[]
getProgress()
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
.boolean
isConsuming()
Gets whether this is a consumingCollectionReader
.-
Methods inherited from interface org.apache.uima.resource.Resource
destroy, getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, initialize, setLogger
-
-
-
-
Method Detail
-
hasNext
boolean hasNext() throws IOException, CollectionException
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
-
isConsuming
boolean isConsuming()
Gets whether this is a consumingCollectionReader
. ConsumingCollectionReader
s remove each element from theCollection
as it is read.- Returns:
- true if and only if this is a consuming
CollectionReader
-
getProgress
Progress[] getProgress()
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).
-
close
void close() throws IOException
Closes thisCollectionReader
, after which it may no longer be used.- Throws:
IOException
- if an I/O failure occurs
-
getProcessingResourceMetaData
ProcessingResourceMetaData getProcessingResourceMetaData()
Gets the metadata that describes thisCasProcesor
.- Returns:
- an object containing all metadata for this CasProcessor
-
-