public abstract class MultiTaskJob<TaskKey,TaskResult,Result> extends Job
Job.Inform, Job.Key, Job.Priority, Job.Type
finished, LOCALDEBUGFLAG, MIN_NUM_SECONDS, reportExecution, timer
Constructor and Description |
---|
MultiTaskJob(java.lang.String jobName,
Tool t,
Consumer<Result> c)
Constructor creates a new instance of MultiTaskJob.
|
Modifier and Type | Method and Description |
---|---|
boolean |
doIt()
This method is not overriden by subclasses.
|
abstract Result |
mergeTaskResults(java.util.Map<TaskKey,TaskResult> taskResults)
This abtract method combines task results into final result.
|
abstract void |
prepareTasks()
This abstract method split large computation into smaller task.
|
abstract TaskResult |
runTask(TaskKey taskKey)
This abtract methods performs computation of each task.
|
void |
startTask(java.lang.String taskName,
TaskKey taskKey)
Schedules task.
|
abort, checkAbort, error, fieldVariableChanged, findValidSnapshot, getAllJobs, getDatabase, getDebug, getDeleteWhenDone, getEditingPreferences, getEnvironment, getExtendedUserInterface, getExtraDebug, getInfo, getInform, getKey, getRunningJob, getScheduledToAbort, getStatus, getTechPool, getTool, getUserInterface, initJobManager, inServerThread, isClientThread, isExamine, isFinished, pipeClient, pipeServer, remove, setCurrentLibraryInJob, setDebug, setProgress, setReportExecutionFlag, setUserInterface, showSnapshot, socketClient, startJob, startJob, startJobOnMyResult, terminateFail, terminateIt, terminateOK, toString, updateIncrementalDRCErrors, updateNetworkErrors
public abstract void prepareTasks() throws JobException
JobException
public abstract TaskResult runTask(TaskKey taskKey) throws JobException
taskKey
- task key which identifies the taskJobException
public abstract Result mergeTaskResults(java.util.Map<TaskKey,TaskResult> taskResults) throws JobException
taskResults
- map which contains result of each completed task.JobException
public final boolean doIt() throws JobException
doIt
in class Job
JobException
public void startTask(java.lang.String taskName, TaskKey taskKey)
taskName
- task name which is appeared in Jobs Explorer TreetaskKey
- task key which identifies the task.