gate.creole
Class AnalyserRunningStrategy

java.lang.Object
  extended by gate.creole.AnalyserRunningStrategy
All Implemented Interfaces:
RunningStrategy

public class AnalyserRunningStrategy
extends Object
implements RunningStrategy

A type running strategy that decides whether the associated PR needs to be run based on the value of a specified feature on the document that the PR needs to be run on. It can only be used for LanguageAnalysers because it needs the document the PR will run on.


Nested Class Summary
 
Nested classes/interfaces inherited from interface gate.creole.RunningStrategy
RunningStrategy.RunAlwaysStrategy, RunningStrategy.UnconditionalRunningStrategy
 
Field Summary
protected  String featureName
           
protected  String featureValue
           
protected  LanguageAnalyser pr
           
protected  int runMode
           
 
Fields inherited from interface gate.creole.RunningStrategy
RUN_ALWAYS, RUN_CONDITIONAL, RUN_NEVER
 
Constructor Summary
AnalyserRunningStrategy(LanguageAnalyser pr, int runMode, String featureName, String featureValue)
           
 
Method Summary
 String getFeatureName()
           
 String getFeatureValue()
           
 ProcessingResource getPR()
          Gets the associated ProcessingResource.
 int getRunMode()
          Returns the run mode (see RunningStrategy.RUN_ALWAYS, RunningStrategy.RUN_NEVER, RunningStrategy.RUN_CONDITIONAL).
 void setFeatureName(String name)
           
 void setFeatureValue(String value)
           
 void setProcessingResource(ProcessingResource pr)
           
 void setRunMode(int mode)
           
 boolean shouldRun()
          If the runMode is RunningStrategy.RUN_ALWAYS returns true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pr

protected LanguageAnalyser pr

runMode

protected int runMode

featureName

protected String featureName

featureValue

protected String featureValue
Constructor Detail

AnalyserRunningStrategy

public AnalyserRunningStrategy(LanguageAnalyser pr,
                               int runMode,
                               String featureName,
                               String featureValue)
Method Detail

shouldRun

public boolean shouldRun()
If the runMode is RunningStrategy.RUN_ALWAYS returns true. If the runMode is RunningStrategy.RUN_NEVER returns false. If the runMode is RunningStrategy.RUN_CONDITIONAL:

Specified by:
shouldRun in interface RunningStrategy
Returns:
a boolean value.

getRunMode

public int getRunMode()
Description copied from interface: RunningStrategy
Returns the run mode (see RunningStrategy.RUN_ALWAYS, RunningStrategy.RUN_NEVER, RunningStrategy.RUN_CONDITIONAL).

Specified by:
getRunMode in interface RunningStrategy
Returns:
and int value.

setRunMode

public void setRunMode(int mode)

setFeatureName

public void setFeatureName(String name)

setFeatureValue

public void setFeatureValue(String value)

getFeatureName

public String getFeatureName()

getFeatureValue

public String getFeatureValue()

getPR

public ProcessingResource getPR()
Description copied from interface: RunningStrategy
Gets the associated ProcessingResource.

Specified by:
getPR in interface RunningStrategy
Returns:
a ProcessingResource value.

setProcessingResource

public void setProcessingResource(ProcessingResource pr)