org.cyberlab.activity.local.task
Class AbstractWorkerTask<Params,Result>

java.lang.Object
  extended by 
      extended by org.cyberlab.activity.local.task.AbstractWorkerTask<Params,Result>
Type Parameters:
Params - The parameters fed to the doInBackground method
Result - The returned result from the doInBackground method
Direct Known Subclasses:
AbstractCreateModelTask, AbstractMatchTask, CreateUnknownTask

public abstract class AbstractWorkerTask<Params,Result>
extends

Abstract task for common handling of tasks performing image feature extraction, model creation and matching. Classes extending this can be handled by the TaskManager.

Author:
Mats-Gøran Karlsen

Field Summary
protected  AbstractGeneralActivity<?> mActivity
           
protected  int threadId
           
 
Constructor Summary
AbstractWorkerTask(AbstractGeneralActivity<?> activity, int uniqueID)
           
 
Method Summary
 void attach(AbstractGeneralActivity<?> activity)
          Method is called from the TaskManager attaching this task to an activity
 void detach()
          Tell the task that the acitivity owning it is unavailable.
 int getId()
          Retrieve the unique id of this task
protected  void onProgressUpdate(java.lang.Integer... values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mActivity

protected AbstractGeneralActivity<?> mActivity

threadId

protected final int threadId
Constructor Detail

AbstractWorkerTask

public AbstractWorkerTask(AbstractGeneralActivity<?> activity,
                          int uniqueID)
Method Detail

getId

public int getId()
Retrieve the unique id of this task

Returns:

attach

public void attach(AbstractGeneralActivity<?> activity)
Method is called from the TaskManager attaching this task to an activity

Parameters:
activity - The activity that wishes to own this task

detach

public void detach()
Tell the task that the acitivity owning it is unavailable. The task will wait for the activity to attach it again. Method is called from TaskManager.


onProgressUpdate

protected void onProgressUpdate(java.lang.Integer... values)