org.apache.uima.analysis_component
Class JCasMultiplier_ImplBase

java.lang.Object
  extended by org.apache.uima.analysis_component.AnalysisComponent_ImplBase
      extended by org.apache.uima.analysis_component.JCasMultiplier_ImplBase
All Implemented Interfaces:
AnalysisComponent

public abstract class JCasMultiplier_ImplBase
extends AnalysisComponent_ImplBase

Base class to be extended by CAS Multipliers that use the CAS interface. A CAS Multiplier can produce multiplie output CASes while processing an input CAS. See AnalysisComponent for a description of how the framework calls the methods on this interface.


Constructor Summary
JCasMultiplier_ImplBase()
           
 
Method Summary
 int getCasInstancesRequired()
          Returns the maximum number of CAS instances that this CAS Multiplier expects to use at the same time.
protected  JCas getEmptyJCas()
          Gets an empty JCas that this CAS Multiplier can then populate.
 Class<JCas> getRequiredCasInterface()
          Returns the specific CAS interface that this AnalysisComponent requires the framework to pass to its AnalysisComponent.process(AbstractCas) method.
 void process(AbstractCas aCAS)
          Inputs a CAS to the AnalysisComponent.
abstract  void process(JCas aJCas)
          This method should be overriden by subclasses.
 
Methods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
batchProcessComplete, collectionProcessComplete, destroy, getContext, getResultSpecification, initialize, reconfigure, setResultSpecification
 
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.analysis_component.AnalysisComponent
hasNext, next
 

Constructor Detail

JCasMultiplier_ImplBase

public JCasMultiplier_ImplBase()
Method Detail

getRequiredCasInterface

public final Class<JCas> getRequiredCasInterface()
Description copied from interface: AnalysisComponent
Returns the specific CAS interface that this AnalysisComponent requires the framework to pass to its AnalysisComponent.process(AbstractCas) method.

Returns:
the required CAS interface. This must specify a subtype of AbstractCas.

getCasInstancesRequired

public int getCasInstancesRequired()
Returns the maximum number of CAS instances that this CAS Multiplier expects to use at the same time. Returns a default value of 1, which will be sufficient for most CAS Multipliers. Only if there is a clear need should this be overridden to return something greater than 1.

Returns:
the number of CAS instances required by this AnalysisComponent.

process

public final void process(AbstractCas aCAS)
                   throws AnalysisEngineProcessException
Description copied from interface: AnalysisComponent
Inputs a CAS to the AnalysisComponent. The AnalysisComponent "owns" this CAS until such time as AnalysisComponent.hasNext() is called and returns false or until process is called again (see class description).

Parameters:
aCAS - A CAS that this AnalysisComponent should process. The framework will ensure that aCAS implements the specific CAS interface specified by the AnalysisComponent.getRequiredCasInterface() method.
Throws:
AnalysisEngineProcessException - if a problem occurs during processing

process

public abstract void process(JCas aJCas)
                      throws AnalysisEngineProcessException
This method should be overriden by subclasses. Inputs a JCAS to the AnalysisComponent. The AnalysisComponent "owns" this JCAS until such time as AnalysisComponent.hasNext() is called and returns false, or until the process method is called again (see AnalysisComponent for details).

Parameters:
aJCas - a JCAS that this AnalysisComponent should process.
Throws:
AnalysisEngineProcessException - if a problem occurs during processing

getEmptyJCas

protected final JCas getEmptyJCas()
Gets an empty JCas that this CAS Multiplier can then populate.

Returns:
an empty JCas


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