Class ASB_impl.AggregateCasIterator
java.lang.Object
org.apache.uima.analysis_engine.asb.impl.ASB_impl.AggregateCasIterator
- All Implemented Interfaces:
CasIterator
- Enclosing class:
- ASB_impl
Inner class implementing the CasIterator returned from the processAndOutputNewCASes(CAS)
method. This class contains most of the execution control logic for the aggregate AE.
-
Field Summary
FieldsModifier and TypeFieldDescriptionSet of CASes that are in circulation (that is, they have been passed to FlowController and the FlowController hasn't yet returned a FinalStep for them).(package private) Stack<ASB_impl.StackFrame>
Stack, which holds StackFrame objects.(package private) CAS
The CAS that was input to the Aggregate AE's process method.(package private) CAS
Holds the next CAS to be returned, if it is known.(package private) UimaTimer
timer for timing processing done during calls to next() -
Constructor Summary
ConstructorsConstructorDescriptionAggregateCasIterator
(CAS inputCas) Creates a new AggregateCasIterator for the given input CAS. -
Method Summary
-
Field Details
-
mInputCas
CAS mInputCasThe CAS that was input to the Aggregate AE's process method. -
casIteratorStack
Stack<ASB_impl.StackFrame> casIteratorStackStack, which holds StackFrame objects. A stack is necessary to handle CasMultipliers, because when a CasMultiplier is invoked we need to save the state of processing of the current CAS and start processing the output CASes instead. Since CasMultipliers can be nested, we need a stack. -
activeCASes
Set of CASes that are in circulation (that is, they have been passed to FlowController and the FlowController hasn't yet returned a FinalStep for them). Needed so we can clean up on error. -
nextCas
CAS nextCasHolds the next CAS to be returned, if it is known. -
timer
UimaTimer timertimer for timing processing done during calls to next()
-
-
Constructor Details
-
AggregateCasIterator
Creates a new AggregateCasIterator for the given input CAS. The CasIterator will return all of the output CASes that this Aggregate AE generates when run on that input CAS, if any.- Parameters:
inputCas
- the CAS to be input to the Aggregate AE (this is the CAS that was passed to the Aggregate AE's processAndOutputNewCASes(CAS) method)- Throws:
AnalysisEngineProcessException
- if processing fails
-
-
Method Details
-
hasNext
Returns whether there are any more CASes to be returned.- Specified by:
hasNext
in interfaceCasIterator
- Returns:
- true if there are more CASes to be returned, false if not
- Throws:
AnalysisEngineProcessException
- if a failure has occurred during processing. If an exception is thrown, this indicates that processing has aborted, so no further calls to the CasIterator should be made.
-
next
Gets the next output CAS.- Specified by:
next
in interfaceCasIterator
- Returns:
- the next CAS.
- Throws:
AnalysisEngineProcessException
- if a failure has occurred during processing. If an exception is thrown, this indicates that processing has aborted, so no further calls to the CasIterator should be made.
-
release
public void release()Description copied from interface:CasIterator
Releases any CASes owned by this CasIterator. You only need to Call this method if you stop using a CasIterator before you have iterated all the way through.- Specified by:
release
in interfaceCasIterator
-
processUntilNextOutputCas
This is the main execution control method for the aggregate AE. It is called by the AggregateCasProcessorCasIterator.next() method. This runs the Aggregate, starting from its current state, until such time as the FlowController indicates a CAS should be returned to the caller. The AggregateCasIterator remembers the state, so calling this method a second time will continue processing from where it left off.- Returns:
- the next CAS to be output. Returns null if the processing of the input CAS has completed.
- Throws:
ProcessingException
- if a failure occurs during processingAnalysisEngineProcessException
-