public class JCasIterator extends Object implements Iterator<org.apache.uima.jcas.JCas>
Constructor and Description |
---|
JCasIterator(org.apache.uima.collection.CollectionReader aReader,
org.apache.uima.analysis_engine.AnalysisEngine... aEngines)
Iterate over the documents loaded by the CollectionReader, running the AnalysisEngine on each
one before yielding them.
|
JCasIterator(org.apache.uima.collection.CollectionReaderDescription aReader,
org.apache.uima.analysis_engine.AnalysisEngineDescription... aEngines)
Iterate over the documents loaded by the given reader, running the analysis engines on each one
before yielding them.
|
JCasIterator(org.apache.uima.collection.CollectionReader aReader,
org.apache.uima.resource.metadata.TypeSystemDescription aTypeSystemDescription)
Iterate over the documents loaded by the CollectionReader.
|
JCasIterator(org.apache.uima.resource.ResourceManager aResMgr,
org.apache.uima.collection.CollectionReader aReader,
org.apache.uima.analysis_engine.AnalysisEngine... aEngines)
Iterate over the documents loaded by the CollectionReader, running the AnalysisEngine on each
one before yielding them.
|
JCasIterator(org.apache.uima.resource.ResourceManager aResMgr,
org.apache.uima.collection.CollectionReaderDescription aReader,
org.apache.uima.analysis_engine.AnalysisEngineDescription... aEngines)
Iterate over the documents loaded by the given reader, running the analysis engines on each one
before yielding them.
|
Modifier and Type | Method and Description |
---|---|
void |
collectionProcessComplete()
Notify analysis engines that the collection process is complete.
|
void |
destroy()
Close and destroy all components.s
|
boolean |
hasNext() |
boolean |
isSelfComplete()
Get whether
collectionProcessComplete() is automatically called. |
boolean |
isSelfDestroy()
Get whether
destroy() is automatically called. |
org.apache.uima.jcas.JCas |
next() |
void |
remove() |
void |
setSelfComplete(boolean aSelfComplete)
Send a
collectionProcessComplete() call to analysis engines when the reader has no
further CASes to produce. |
void |
setSelfDestroy(boolean aSelfDestroy)
Send a destroy call to analysis engines when the reader has no further CASes to produce or if
an error occurs.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public JCasIterator(org.apache.uima.collection.CollectionReaderDescription aReader, org.apache.uima.analysis_engine.AnalysisEngineDescription... aEngines) throws org.apache.uima.cas.CASException, org.apache.uima.resource.ResourceInitializationException
aReader
- The CollectionReader for loading documents.aEngines
- The AnalysisEngines for processing documents.org.apache.uima.resource.ResourceInitializationException
- if a failure occurs during initialization of the componentsorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic JCasIterator(org.apache.uima.resource.ResourceManager aResMgr, org.apache.uima.collection.CollectionReaderDescription aReader, org.apache.uima.analysis_engine.AnalysisEngineDescription... aEngines) throws org.apache.uima.cas.CASException, org.apache.uima.resource.ResourceInitializationException
aResMgr
- The ResourceManager
used to create the components and the JCas. If this
parameter is null
then ResourceManagerFactory.newResourceManager()
will be used to obtain a resource manager. If a new resource manager was internally
created, it is destroyed at the end of the pipeline (if isSelfDestroy()
).aReader
- The CollectionReader for loading documents.aEngines
- The AnalysisEngines for processing documents.org.apache.uima.resource.ResourceInitializationException
- if a failure occurs during initialization of the componentsorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic JCasIterator(org.apache.uima.collection.CollectionReader aReader, org.apache.uima.analysis_engine.AnalysisEngine... aEngines) throws org.apache.uima.cas.CASException, org.apache.uima.resource.ResourceInitializationException
aReader
- The CollectionReader for loading documents.aEngines
- The AnalysisEngines for processing documents.org.apache.uima.resource.ResourceInitializationException
- if a failure occurs during initialization of the componentsorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic JCasIterator(org.apache.uima.collection.CollectionReader aReader, org.apache.uima.resource.metadata.TypeSystemDescription aTypeSystemDescription) throws org.apache.uima.cas.CASException, org.apache.uima.resource.ResourceInitializationException
aReader
- The CollectionReader for loading documents.aTypeSystemDescription
- a type system descriptionorg.apache.uima.resource.ResourceInitializationException
- if a failure occurs during initialization of the componentsorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic JCasIterator(org.apache.uima.resource.ResourceManager aResMgr, org.apache.uima.collection.CollectionReader aReader, org.apache.uima.analysis_engine.AnalysisEngine... aEngines) throws org.apache.uima.cas.CASException, org.apache.uima.resource.ResourceInitializationException
aResMgr
- The ResourceManager
used to create the JCas. Should be the one also used by
the CollectionReader and the AnalysisEngines. If this parameter is null
then
ResourceManagerFactory.newResourceManager()
will be used to obtain a resource
manager. If a new resource manager was internally created, it is destroyed at the end
of the pipeline (if isSelfDestroy()
).aReader
- The CollectionReader for loading documents.aEngines
- The AnalysisEngines for processing documents.org.apache.uima.resource.ResourceInitializationException
- if a failure occurs during initialization of the componentsorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic boolean hasNext()
public org.apache.uima.jcas.JCas next()
public void collectionProcessComplete() throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
org.apache.uima.analysis_engine.AnalysisEngineProcessException
- if there was a problem completing the processpublic void destroy()
public boolean isSelfComplete()
collectionProcessComplete()
is automatically called.collectionProcessComplete()
is automatically called.public void setSelfComplete(boolean aSelfComplete)
collectionProcessComplete()
call to analysis engines when the reader has no
further CASes to produce.aSelfComplete
- whether to enable the automatic call to collectionProcessComplete()
public boolean isSelfDestroy()
destroy()
is automatically called.destroy()
is automatically called.public void setSelfDestroy(boolean aSelfDestroy)
aSelfDestroy
- whether to enable the automatic call to Resource.destroy()
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.