org.dftproject.genesis.core.research
Class TaskFamily

java.lang.Object
  extended by org.dftproject.genesis.core.research.TaskFamily
Direct Known Subclasses:
PooledTaskFamily

public abstract class TaskFamily
extends java.lang.Object

A TaskFamily is a collection of tasks working on a particular objective.


Constructor Summary
TaskFamily(Objective objective)
          Creates a TaskFamily for the given objective.
 
Method Summary
 void addListener(IFamilyListener listener)
          Adds a listener to this family.
 void addTask(Task task)
          Adds a task to this family.
 void cancel()
          Cancels this task family and all the tasks that comprise it.
protected  void finished()
          Called when this family is finished working on the objective.
abstract  java.lang.String getDescription()
          Returns the description of this task family
 java.lang.String getFullDescription()
          Returns a full description of this task family (including canceled status).
abstract  org.eclipse.swt.graphics.Image getIcon()
          Returns the icon for this task family
 Objective getObjective()
          Returns the objective this task family is working on.
 java.util.Set<Task> getTasks()
          Returns the set of tasks that comprise this family.
 boolean isCanceled()
          Returns whether or not this family has been canceled.
 void removeListener(IFamilyListener listener)
          Removes a listener from this family
protected  void removeTask(Task task)
          Removes a task from this family
protected  void taskCanceled(Task task)
          Called when a task that belongs to this family is canceled.
protected  void taskUpdated(Task task)
          Called when a task that belongs to this family is updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskFamily

public TaskFamily(Objective objective)
Creates a TaskFamily for the given objective.

Parameters:
objective - an objective
Method Detail

getObjective

public Objective getObjective()
Returns the objective this task family is working on.

Returns:
the objective

addTask

public void addTask(Task task)
Adds a task to this family.

Parameters:
task - a task

getTasks

public java.util.Set<Task> getTasks()
Returns the set of tasks that comprise this family.

Returns:
the set of tasks that comprise this family

cancel

public void cancel()
Cancels this task family and all the tasks that comprise it.


isCanceled

public boolean isCanceled()
Returns whether or not this family has been canceled.

Returns:
whether or not this family has been canceled

addListener

public void addListener(IFamilyListener listener)
Adds a listener to this family.

Parameters:
listener - a family listener

removeListener

public void removeListener(IFamilyListener listener)
Removes a listener from this family

Parameters:
listener - a family listener

taskCanceled

protected void taskCanceled(Task task)
Called when a task that belongs to this family is canceled.

Parameters:
task - a task that belongs to this family

taskUpdated

protected void taskUpdated(Task task)
Called when a task that belongs to this family is updated.

Parameters:
task - a task that belongs to this family

removeTask

protected void removeTask(Task task)
Removes a task from this family

Parameters:
task - a task that belongs to this family

finished

protected void finished()
Called when this family is finished working on the objective.


getFullDescription

public java.lang.String getFullDescription()
Returns a full description of this task family (including canceled status).

Returns:
a full description of this family

getDescription

public abstract java.lang.String getDescription()
Returns the description of this task family

Returns:
a description

getIcon

public abstract org.eclipse.swt.graphics.Image getIcon()
Returns the icon for this task family

Returns:
an icon