Package moa.tasks
Class AbstractTask
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.tasks.AbstractTask
-
- All Implemented Interfaces:
Configurable
,Serializable
,MOAObject
,OptionHandler
,Task
- Direct Known Subclasses:
CacheShuffledStream
,ExperimenterTask
,MainTask
public abstract class AbstractTask extends AbstractOptionHandler implements Task
Abstract Task. All runnable tasks in MOA extend this class.- Version:
- $Revision: 7 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description AbstractTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
doTask()
This method performs this task, when TaskMonitor and ObjectRepository are no needed.Object
doTask(TaskMonitor monitor, ObjectRepository repository)
This method performs this task.protected abstract Object
doTaskImpl(TaskMonitor monitor, ObjectRepository repository)
This method performs this task.void
getDescription(StringBuilder sb, int indent)
Returns a string representation of this object.String
getTaskName()
Gets the name of this task.protected void
prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
This method describes the implementation of how to prepare this object for use.-
Methods inherited from class moa.options.AbstractOptionHandler
copy, getCLICreationString, getOptions, getPreparedClassOption, getPurposeString, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.tasks.Task
getTaskResultType
-
-
-
-
Method Detail
-
getTaskName
public String getTaskName()
Gets the name of this task.- Returns:
- the name of this task
-
doTask
public Object doTask()
Description copied from interface:Task
This method performs this task, when TaskMonitor and ObjectRepository are no needed.
-
doTask
public Object doTask(TaskMonitor monitor, ObjectRepository repository)
Description copied from interface:Task
This method performs this task.AbstractTask
implements this method so all its extensions only need to implementdoTaskImpl
-
doTaskImpl
protected abstract Object doTaskImpl(TaskMonitor monitor, ObjectRepository repository)
This method performs this task.AbstractTask
implementsdoTask
so all its extensions only need to implementdoTaskImpl
.- Parameters:
monitor
- the TaskMonitor to userepository
- the ObjectRepository to use- Returns:
- an object with the result of this task
-
prepareForUseImpl
protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
Description copied from class:AbstractOptionHandler
This method describes the implementation of how to prepare this object for use. All classes that extends this class have to implementprepareForUseImpl
and notprepareForUse
sinceprepareForUse
callsprepareForUseImpl
.- Specified by:
prepareForUseImpl
in classAbstractOptionHandler
- Parameters:
monitor
- the TaskMonitor to userepository
- the ObjectRepository to use
-
getDescription
public void getDescription(StringBuilder sb, int indent)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Specified by:
getDescription
in interfaceMOAObject
- Parameters:
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
-