|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.smi.protegex.owl.inference.protegeowl.task.AbstractReasonerTask
User: matthewhorridge
The Univeristy Of Manchester
Medical Informatics Group
Date: Aug 13, 2004
ReasonerTask
that
implements several useful methods to set the task state and
simultaneously notify listeners of state changes.
Field Summary | |
private boolean |
abortTask
|
private String |
description
|
private ReasonerTaskEvent |
evt
|
private ArrayList |
listeners
|
private String |
message
|
private int |
progress
|
private boolean |
progressIndeterminate
|
private DIGTranslator |
translator
|
Constructor Summary | |
AbstractReasonerTask(ProtegeOWLReasoner protegeOWLReasoner)
|
Method Summary | |
void |
addTaskListener(ReasonerTaskListener lsnr)
Adds a listener. |
protected void |
doAbortCheck()
|
protected void |
fireDescriptionChangedEvent()
Informs registered listeners of a change in task description. |
protected void |
fireMessageChangedEvent()
Informs registered listeners of a change in task message |
protected void |
fireProgressChangedEvent()
Informs registered listeners of a change in task progress |
protected void |
fireProgressIndeterminateChnaged()
Informs registered listeners of a change in the state of whether the task progress can be determined or not. |
protected void |
fireTaskCompletedEvent()
Informs registered listeners that the task was completed. |
protected void |
fireTaskFailedEvent()
Informs registered listeners that the task failed. |
String |
getDescription()
Gets a high level description of the task. |
String |
getMessage()
Gets the current task message. |
int |
getProgress()
Gets the current progress of a task. |
protected DIGTranslator |
getTranslator()
Gets the translator that should be used to convert Protege-OWL to DIG and vice versa |
boolean |
isProgressIndeterminate()
Determines whether the task can determine its overall progress. |
boolean |
isRequestAbort()
|
protected void |
postLogRecord(ReasonerLogRecord logRecord)
|
void |
removeTaskListener(ReasonerTaskListener lsnr)
Removes a previously added listener. |
protected void |
setDescription(String description)
Sets the high level task description, notifiying listeners of the change in description. |
protected void |
setMessage(String message)
Sets the task message, notifying any listeners of the change in message. |
protected void |
setProgress(int progress)
Sets the progress of the task, simultaneously notifying listeners that the progress has changed. |
protected void |
setProgressIndeterminate(boolean b)
Sets the progress as indeterminate, notifying listeners of the change. |
void |
setRequestAbort()
|
protected void |
setTaskCompleted()
Sets the task as having a 'complete' status, notifying listeners that the task is complete. |
protected void |
setTaskFailed()
Sets the task as having a 'failed' status, notifying listeners that the task failed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.stanford.smi.protegex.owl.inference.protegeowl.task.ReasonerTask |
getTaskSize, run |
Field Detail |
private ArrayList listeners
private int progress
private boolean progressIndeterminate
private String description
private String message
private ReasonerTaskEvent evt
private boolean abortTask
private DIGTranslator translator
Constructor Detail |
public AbstractReasonerTask(ProtegeOWLReasoner protegeOWLReasoner)
Method Detail |
protected DIGTranslator getTranslator()
protected void setProgress(int progress)
progress
- The new progress valueprotected void setProgressIndeterminate(boolean b)
b
- true
if the task progress
cannot be determined, false
if the
task progress can be determined.public int getProgress()
ReasonerTask
getProgress
in interface ReasonerTask
public boolean isProgressIndeterminate()
ReasonerTask
isProgressIndeterminate
in interface ReasonerTask
true
if the progress cannot
be determined. false
if the progress
can be determined. If a task is indeterminate the
results for getTaskSize
and getProgress
are undefined.public String getDescription()
ReasonerTask
getDescription
in interface ReasonerTask
protected void setDescription(String description)
description
- The new task description.protected void setMessage(String message)
message
- The new message.public String getMessage()
ReasonerTask
getMessage
in interface ReasonerTask
protected void setTaskCompleted()
protected void setTaskFailed()
public void addTaskListener(ReasonerTaskListener lsnr)
addTaskListener
in interface ReasonerTask
public void removeTaskListener(ReasonerTaskListener lsnr)
removeTaskListener
in interface ReasonerTask
protected void fireProgressChangedEvent()
protected void fireProgressIndeterminateChnaged()
protected void fireDescriptionChangedEvent()
protected void fireMessageChangedEvent()
protected void fireTaskFailedEvent()
protected void fireTaskCompletedEvent()
protected void postLogRecord(ReasonerLogRecord logRecord)
public void setRequestAbort()
setRequestAbort
in interface ReasonerTask
public boolean isRequestAbort()
isRequestAbort
in interface ReasonerTask
protected void doAbortCheck() throws DIGReasonerException
DIGReasonerException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |