gate.creole
Class ConditionalSerialController

java.lang.Object
  |
  +--gate.util.AbstractFeatureBearer
        |
        +--gate.creole.AbstractResource
              |
              +--gate.creole.AbstractController
                    |
                    +--gate.creole.SerialController
                          |
                          +--gate.creole.ConditionalSerialController
All Implemented Interfaces:
ConditionalController, Controller, CreoleListener, EventListener, Executable, FeatureBearer, NameBearer, Resource, Serializable
Direct Known Subclasses:
ConditionalSerialAnalyserController

public class ConditionalSerialController
extends SerialController
implements ConditionalController

Execute a list of PRs serially. For each PR a running strategy is stored which decides whether the PR will be run always, never or upon a condition being satisfied. This controller uses AnalyserRunningStrategy objects as running strategies and they only work with LanguageAnalysers so the PRs that are not analysers will get a default "run always" strategy.

See Also:
Serialized Form

Constructor Summary
ConditionalSerialController()
           
 
Method Summary
 void add(int index, ProcessingResource pr)
          Set a PR at a specified location.
 void add(ProcessingResource pr)
          Add a PR to the end of the execution list.
 void cleanup()
          Cleans the internal data and prepares this object to be collected
 Collection getRunningStrategies()
          Gets the collection of running strategies for the contained PRs.
 ProcessingResource remove(int index)
           
 boolean remove(ProcessingResource pr)
           
 void setRunningStrategies(Collection strategies)
          Populates this controller with the appropiate running strategies from a collection of running strategies (optional operation).
 void setRunningStrategy(int index, AnalyserRunningStrategy strategy)
           
 
Methods inherited from class gate.creole.SerialController
datastoreClosed, datastoreCreated, datastoreOpened, execute, getPRs, resourceLoaded, resourceRenamed, resourceUnloaded, set, setPRs
 
Methods inherited from class gate.creole.AbstractController
addProgressListener, addStatusListener, getName, getOffendingPocessingResources, init, interrupt, isInterrupted, removeProgressListener, removeStatusListener, setName
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getParameterValue, getParameterValue, removeResourceListeners, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.Controller
getPRs, setPRs
 
Methods inherited from interface gate.Resource
getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 
Methods inherited from interface gate.Executable
execute, interrupt, isInterrupted
 

Constructor Detail

ConditionalSerialController

public ConditionalSerialController()
Method Detail

getRunningStrategies

public Collection getRunningStrategies()
Description copied from interface: ConditionalController
Gets the collection of running strategies for the contained PRs. The iterator of this collection should return the running strategies in sync with the iterator for the getPRs() method of Controller.
Specified by:
getRunningStrategies in interface ConditionalController
Following copied from interface: gate.creole.ConditionalController
Returns:
a Collection object.

add

public void add(int index,
                ProcessingResource pr)
Set a PR at a specified location. The running strategy defaults to run always.
Overrides:
add in class SerialController
Parameters:
index - the position for the PR
pr - the PR to be set.

add

public void add(ProcessingResource pr)
Add a PR to the end of the execution list.
Overrides:
add in class SerialController
Parameters:
pr - the PR to be added.

remove

public ProcessingResource remove(int index)
Overrides:
remove in class SerialController

remove

public boolean remove(ProcessingResource pr)
Overrides:
remove in class SerialController

setRunningStrategy

public void setRunningStrategy(int index,
                               AnalyserRunningStrategy strategy)

setRunningStrategies

public void setRunningStrategies(Collection strategies)
Populates this controller with the appropiate running strategies from a collection of running strategies (optional operation). Controllers that are serializable must implement this method needed by GATE to restore their contents.
Specified by:
setRunningStrategies in interface ConditionalController
Throws:
UnsupportedOperationException - if the setPRs method is not supported by this controller.

cleanup

public void cleanup()
Cleans the internal data and prepares this object to be collected
Specified by:
cleanup in interface Resource
Overrides:
cleanup in class SerialController