gate.creole
Class AbstractProcessingResource
java.lang.Object
|
+--gate.util.AbstractFeatureBearer
|
+--gate.creole.AbstractResource
|
+--gate.creole.AbstractProcessingResource
- All Implemented Interfaces:
- ANNIEConstants, Executable, FeatureBearer, NameBearer, ProcessingResource, Resource, Serializable
- Direct Known Subclasses:
- AbstractLanguageAnalyser
- public abstract class AbstractProcessingResource
- extends AbstractResource
- implements ProcessingResource, ANNIEConstants
A convenience implementation of ProcessingResource with some default
code.
- See Also:
- Serialized Form
Fields inherited from interface gate.creole.ANNIEConstants |
ANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DOCUMENT_COREF_FEATURE_NAME, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_MAJOR_TYPE_FEATURE_NAME, LOOKUP_MINOR_TYPE_FEATURE_NAME, MONEY_ANNOTATION_TYPE, ORGANIZATION_ANNOTATION_TYPE, PERSON_ANNOTATION_TYPE, PERSON_GENDER_FEATURE_NAME, PR_NAMES, SENTENCE_ANNOTATION_TYPE, SPACE_TOKEN_ANNOTATION_TYPE, TOKEN_ANNOTATION_TYPE, TOKEN_CATEGORY_FEATURE_NAME, TOKEN_KIND_FEATURE_NAME, TOKEN_LENGTH_FEATURE_NAME, TOKEN_ORTH_FEATURE_NAME, TOKEN_STRING_FEATURE_NAME |
Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
AbstractProcessingResource
public AbstractProcessingResource()
init
public Resource init()
throws ResourceInstantiationException
- Initialise this resource, and return it.
- Specified by:
init
in interface Resource
- Overrides:
init
in class AbstractResource
execute
public void execute()
throws ExecutionException
- Run the resource. It doesn't make sense not to override
this in subclasses so the default implementation signals an
exception.
- Specified by:
execute
in interface Executable
reInit
public void reInit()
throws ResourceInstantiationException
- Reinitialises the processing resource. After calling this method the
resource should be in the state it is after calling init.
If the resource depends on external resources (such as rules files) then
the resource will re-read those resources. If the data used to create
the resource has changed since the resource has been created then the
resource will change too after calling reInit().
The implementation in this class simply calls
init()
. This
functionality must be overriden by derived classes as necessary.
- Specified by:
reInit
in interface ProcessingResource
cleanup
public void cleanup()
- should clear all internal data of the resource. Does nothing now
- Specified by:
cleanup
in interface Resource
- Overrides:
cleanup
in class AbstractResource
isInterrupted
public boolean isInterrupted()
- Checks whether this PR has been interrupted since the lsat time its
execute()
method was called.
- Specified by:
isInterrupted
in interface ProcessingResource
interrupt
public void interrupt()
- Notifies this PR that it should stop its execution as soon as possible.
- Specified by:
interrupt
in interface ProcessingResource
removeStatusListener
public void removeStatusListener(StatusListener l)
- Removes a
StatusListener
from the list of listeners for
this processing resource
addStatusListener
public void addStatusListener(StatusListener l)
- Adds a
StatusListener
to the list of listeners for
this processing resource
addProgressListener
public void addProgressListener(ProgressListener l)
- Adds a
ProgressListener
to the list of listeners for
this processing resource.
removeProgressListener
public void removeProgressListener(ProgressListener l)
- Removes a
ProgressListener
from the list of listeners
for this processing resource.