net.aavalla.utils.jobpool
Class ParameterizedJob<R,P extends ParameterCollection>

java.lang.Object
  extended by net.aavalla.utils.jobpool.Job<R,P>
      extended by net.aavalla.utils.jobpool.ParameterizedJob<R,P>
All Implemented Interfaces:
java.lang.Comparable<Job>
Direct Known Subclasses:
VennDiagram.ExportVennImageJob, VennDiagram.UpdateJob

public abstract class ParameterizedJob<R,P extends ParameterCollection>
extends Job<R,P>

Author:
Lari Natri

Field Summary
 
Fields inherited from class net.aavalla.utils.jobpool.Job
CANCELLEDRESULT
 
Constructor Summary
ParameterizedJob()
           
 
Method Summary
 ParameterCollection getFinalParametersForDisplay()
          Returns the ParameterCollection for displaying.
protected abstract  P getNonfinalEditableParameters()
          This should be overridden in derived classes.
 ParameterCollection getParametersForModification()
          Returns a ParameterCollection object to be edited before starting the Job with it.
protected abstract  R work(P params)
          ABSTRACT PROTECTED
 
Methods inherited from class net.aavalla.utils.jobpool.Job
addCategory, addConflictingCategory, addJobFinishedListener, addJobFinishedListenerSwing, addSubjob, cancelPending, compareTo, getCategories, getConflictingCategories, getExecutionTime, getName, getPriority, getProgress, getState, getStatus, getUseRecursiveCancel, getWaitingTime, isAncestorOf, isSilent, removeJobFinishedListener, reportProgress, reportStatus, setCancelPending, setCategories, setConflictingCategories, setName, setPriority, setSilent, setSupportsCancellation, setUseRecursiveCancel, sharesAncestorWith, supportsCancellation, toString, waitSubJob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterizedJob

public ParameterizedJob()
Method Detail

getParametersForModification

public final ParameterCollection getParametersForModification()
Returns a ParameterCollection object to be edited before starting the Job with it.

Returns:

getFinalParametersForDisplay

public final ParameterCollection getFinalParametersForDisplay()
Returns the ParameterCollection for displaying. If parameter is not set yet, or it is not yet finalized, null is returned.

Returns:
parameters used by this job or null, if not set final yet

getNonfinalEditableParameters

protected abstract P getNonfinalEditableParameters()
This should be overridden in derived classes. The method should return a non-final ParameterCollection object filled with default values and annotated with FieldAnnotation annotations in such a way that those parameters can be modified. That same object (with modifications) will later be passed to work() method as a parameter.

Returns:
parameters object which is not final yet

work

protected abstract R work(P params)
                   throws java.lang.Throwable
Description copied from class: Job
ABSTRACT PROTECTED

Specified by:
work in class Job<R,P extends ParameterCollection>
Throws:
java.lang.Throwable