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:
- Controller, ConditionalController, CreoleListener, Executable, Resource, FeatureBearer, NameBearer, Serializable, EventListener
- 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
|
Field Summary |
protected List |
strategiesList
The list of running strategies for the member PRs. |
| Methods inherited from class gate.creole.SerialController |
checkParameters, datastoreClosed, datastoreCreated, datastoreOpened, execute, getPRs, resourceLoaded, resourceRenamed, resourceUnloaded, set, setPRs |
| Methods inherited from class gate.creole.AbstractController |
addControllerListener, addProgressListener, addStatusListener, fireProcessFinished, fireProgressChanged, fireResourceAdded, fireResourceRemoved, fireStatusChanged, getName, getOffendingPocessingResources, init, interrupt, isInterrupted, removeControllerListener, removeProgressListener, removeStatusListener, setName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
strategiesList
protected List strategiesList
- The list of running strategies for the member PRs.
ConditionalSerialController
public ConditionalSerialController()
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
- 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 PRpr - 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.
runComponent
protected void runComponent(int componentIndex)
throws ExecutionException
- Executes a
ProcessingResource.
- Overrides:
runComponent in class SerialController
- Throws:
ExecutionException
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