|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CollectionReader
A CollectionReader is used to iterate over the elements of a Collection. Iteration
is done using the BaseCollectionReader.hasNext() and getNext(CAS) methods. Each element of the
collection is returned in a CAS.
A consuming CollectionReader is one that removes each element from the
collection as it is read. To find out whether a CollectionReader will consume
elements in this way, call the BaseCollectionReader.isConsuming() method.
Users of a CollectionReader should always close it when they are
finished using it.
CollectionReaders are also ConfigurableResources, and can be
instantiated from descriptors. See
XMLParser.parseCollectionReaderDescription(XMLInputSource) and
UIMAFramework.produceCollectionReader(ResourceSpecifier,Map) for more
information.
| Field Summary |
|---|
| 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 |
| 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 |
| Method Summary | |
|---|---|
CasInitializer |
getCasInitializer()
Deprecated. As of v2.0 CAS Initializers are deprecated. |
void |
getNext(CAS aCAS)
Gets the next element of the collection. |
void |
setCasInitializer(CasInitializer aCasInitializer)
Deprecated. As of v2.0 CAS Initializers are deprecated. |
void |
typeSystemInit(TypeSystem aTypeSystem)
Informs this CollectionReader that the CAS TypeSystem has changed. |
| Methods inherited from interface org.apache.uima.collection.base_cpm.BaseCollectionReader |
|---|
close, getProcessingResourceMetaData, getProgress, hasNext, isConsuming |
| Methods inherited from interface org.apache.uima.resource.Resource |
|---|
destroy, getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, initialize, setLogger |
| Methods inherited from interface org.apache.uima.resource.ConfigurableResource |
|---|
getConfigParameterValue, getConfigParameterValue, reconfigure, setConfigParameterValue, setConfigParameterValue |
| Methods inherited from interface org.apache.uima.resource.Resource |
|---|
destroy, getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, initialize, setLogger |
| Method Detail |
|---|
void typeSystemInit(TypeSystem aTypeSystem)
throws ResourceInitializationException
Resource.initialize(ResourceSpecifier,Map), and will call it
again whenever the CAS TypeSystem changes.
In this method, the CollectionReader should use the TypeSystem to resolve the names of
Type and Features to the actual Type and
Feature objects, which can then be used during processing.
aTypeSystem - the CAS TypeSystem
ResourceInitializationException - if the type system is not compatible with this Collection Reader
void getNext(CAS aCAS)
throws IOException,
CollectionException
CollectionReader (see BaseCollectionReader.isConsuming()), this
element will also be removed from the collection.
aCAS - the CAS to populate with the next element of the collection
UIMA_IllegalStateException - if there are no more elements left in the collection
IOException - if an I/O failure occurs
CollectionException - if there is some other problem with reading from the Collection@Deprecated CasInitializer getCasInitializer()
@Deprecated void setCasInitializer(CasInitializer aCasInitializer)
aCasInitializer - the CAS Initializer for this Collection Reader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||