org.apache.uima.flow
Class CasFlow_ImplBase

java.lang.Object
  extended by org.apache.uima.flow.CasFlow_ImplBase
All Implemented Interfaces:
Flow

public abstract class CasFlow_ImplBase
extends Object
implements Flow

Convenience base class for Flow objects that use the CAS interface. Stores the CAS in a field made accessible through the protected getCas() method.


Constructor Summary
CasFlow_ImplBase()
           
 
Method Summary
protected  CAS getCas()
          Gets the CAS being routed by this Flow object.
 Flow newCasProduced(AbstractCas newCas, String producedBy)
          Overriden to check that newCas is an instanceof CAS.
protected  Flow newCasProduced(CAS newCas, String producedBy)
          By default, throws an exception to indicate this this Flow object does not support new CASes being produced in the middle of the flow.
 void setCas(CAS aCAS)
          Sets the CAS to be routed by this Flow object.
 
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.flow.Flow
next
 

Constructor Detail

CasFlow_ImplBase

public CasFlow_ImplBase()
Method Detail

setCas

public void setCas(CAS aCAS)
Sets the CAS to be routed by this Flow object. This should be called from the FlowController.computeFlow(AbstractCas) method after this Flow object is instantiated.

Parameters:
aCAS - the CAS to be routed by this Flow object

newCasProduced

public final Flow newCasProduced(AbstractCas newCas,
                                 String producedBy)
                          throws AnalysisEngineProcessException
Overriden to check that newCas is an instanceof CAS. If it is, then newCasProduced(CAS,String) is called. If not, an exception is thrown.

Specified by:
newCasProduced in interface Flow
Parameters:
newCas - the new CAS
producedBy - key of the AnalysisEngine (CAS Multiplier) that produced the new CAS
Returns:
a new Flow object that has responsibility for routing aCAS through the Aggregate Analysis Engine.
Throws:
AnalysisEngineProcessException
See Also:
Flow.newCasProduced(AbstractCas, String)

newCasProduced

protected Flow newCasProduced(CAS newCas,
                              String producedBy)
                       throws AnalysisEngineProcessException
By default, throws an exception to indicate this this Flow object does not support new CASes being produced in the middle of the flow. Subclasses can override to implement handling for this.

Parameters:
newCas - the new CAS
producedBy - the key of the CAS Multiplier that produced this CAS
Returns:
a Flow object that will be used to route the new CAS
Throws:
AnalysisEngineProcessException
See Also:
Flow.newCasProduced(AbstractCas, String)

getCas

protected CAS getCas()
Gets the CAS being routed by this Flow object.

Returns:
the CAS being routed by this Flow object


Copyright © 2007 The Apache Software Foundation. All Rights Reserved.