|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.util.AbstractFeatureBearer
gate.creole.AbstractResource
gate.creole.AbstractProcessingResource
public abstract class AbstractProcessingResource
A convenience implementation of ProcessingResource with some default code.
Nested Class Summary | |
---|---|
protected class |
AbstractProcessingResource.InternalStatusListener
A simple status listener used to forward the events upstream. |
protected class |
AbstractProcessingResource.IntervalProgressListener
A progress listener used to convert a 0..100 interval into a smaller one |
Field Summary | |
---|---|
protected boolean |
interrupted
|
Fields inherited from class gate.creole.AbstractResource |
---|
name |
Fields inherited from class gate.util.AbstractFeatureBearer |
---|
features |
Constructor Summary | |
---|---|
AbstractProcessingResource()
|
Method Summary | |
---|---|
void |
addProgressListener(ProgressListener l)
Adds a ProgressListener to the list of listeners for
this processing resource. |
void |
addStatusListener(StatusListener l)
Adds a StatusListener to the list of listeners for
this processing resource |
void |
cleanup()
should clear all internal data of the resource. |
void |
execute()
Run the resource. |
protected void |
fireProcessFinished()
Notifies all the ProgressListener s of a progress
finished. |
protected void |
fireProgressChanged(int e)
Notifies all the ProgressListener s of a progress change
event. |
protected void |
fireStatusChanged(String e)
Notifies all the StatusListener s of a change of status. |
Resource |
init()
Initialise this resource, and return it. |
void |
interrupt()
Notifies this PR that it should stop its execution as soon as possible. |
boolean |
isInterrupted()
Checks whether this PR has been interrupted since the last time its execute() method was called. |
void |
reInit()
Reinitialises the processing resource. |
void |
removeProgressListener(ProgressListener l)
Removes a ProgressListener from the list of listeners
for this processing resource. |
void |
removeStatusListener(StatusListener l)
Removes a StatusListener from the list of listeners for
this processing resource |
Methods inherited from class gate.creole.AbstractResource |
---|
checkParameterValues, getBeanInfo, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
Methods inherited from class gate.util.AbstractFeatureBearer |
---|
getFeatures, setFeatures |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gate.Resource |
---|
getParameterValue, setParameterValue, setParameterValues |
Methods inherited from interface gate.util.FeatureBearer |
---|
getFeatures, setFeatures |
Methods inherited from interface gate.util.NameBearer |
---|
getName, setName |
Field Detail |
---|
protected boolean interrupted
Constructor Detail |
---|
public AbstractProcessingResource()
Method Detail |
---|
public Resource init() throws ResourceInstantiationException
init
in interface Resource
init
in class AbstractResource
ResourceInstantiationException
public void execute() throws ExecutionException
execute
in interface Executable
ExecutionException
public void reInit() throws ResourceInstantiationException
init()
. This
functionality must be overriden by derived classes as necessary.
reInit
in interface ProcessingResource
ResourceInstantiationException
public void cleanup()
cleanup
in interface Resource
cleanup
in class AbstractResource
public boolean isInterrupted()
execute()
method was called.
isInterrupted
in interface Executable
public void interrupt()
interrupt
in interface Executable
public void removeStatusListener(StatusListener l)
StatusListener
from the list of listeners for
this processing resource
public void addStatusListener(StatusListener l)
StatusListener
to the list of listeners for
this processing resource
protected void fireStatusChanged(String e)
StatusListener
s of a change of status.
e
- the message describing the status changepublic void addProgressListener(ProgressListener l)
ProgressListener
to the list of listeners for
this processing resource.
public void removeProgressListener(ProgressListener l)
ProgressListener
from the list of listeners
for this processing resource.
protected void fireProgressChanged(int e)
ProgressListener
s of a progress change
event.
e
- the new value of execution completionprotected void fireProcessFinished()
ProgressListener
s of a progress
finished.
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |