gate.creole
Class AnalyserRunningStrategy

java.lang.Object
  |
  +--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 inherited from class gate.creole.RunningStrategy
RunningStrategy.RunAlwaysStrategy
 
Field Summary
 
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 RUN_ALWAYS, RUN_NEVER, 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:

getRunMode

public int getRunMode()
Description copied from interface: RunningStrategy
Returns the run mode (see RUN_ALWAYS, RUN_NEVER, 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)