dcf.tasks
Class SimpleTask
dcf.tasks.SimpleTask
- All Implemented Interfaces:
- Task
- public class SimpleTask
- implements Task
This is a test Task - It a set of integers to be proccessed.
- Author:
- Tal Salmona
|
Method Summary |
void |
addResult(java.lang.Object obj)
|
void |
divide()
Divide the task into parts - if the data is a List it is already divided. |
java.util.Vector |
generate()
If this is a circular task it should generate a vector of new tasks |
java.lang.Object |
getData()
|
dcf.tasks.String |
getName()
|
java.lang.Object |
getResults()
|
int |
getSize()
|
boolean |
hasMore()
|
boolean |
isCircular()
The Distributer will call this method when a Task is returned by the client.
If the task is circualr the client will call the generate() method to create
additinal tasks. |
java.lang.Object |
next()
|
void |
processResults()
Called by Distributer when a task is returned. |
void |
setData(java.lang.Object obj)
|
void |
setName(dcf.tasks.String n)
|
void |
setParent(Worker w)
Sets the parent for this task. |
| Methods inherited from interface dcf.server.Task |
setName |
SimpleTask
public SimpleTask()
setData
public void setData(java.lang.Object obj)
- Specified by:
setData in interface Task
- Following copied from interface:
dcf.server.Task
- Parameters:
obj - Most commonly a Vector of data to be processed.
getData
public java.lang.Object getData()
- Specified by:
getData in interface Task
divide
public void divide()
- Description copied from interface:
Task
- Divide the task into parts - if the data is a List it is already divided.
- Specified by:
divide in interface Task
hasMore
public boolean hasMore()
- Specified by:
hasMore in interface Task
next
public java.lang.Object next()
- Specified by:
next in interface Task
getSize
public int getSize()
- Specified by:
getSize in interface Task
addResult
public void addResult(java.lang.Object obj)
- Specified by:
addResult in interface Task
- Following copied from interface:
dcf.server.Task
- Parameters:
obj - An Object to add to the results.
getResults
public java.lang.Object getResults()
- Specified by:
getResults in interface Task
setName
public void setName(dcf.tasks.String n)
getName
public dcf.tasks.String getName()
- Specified by:
getName in interface Task
isCircular
public boolean isCircular()
- Description copied from interface:
Task
- The Distributer will call this method when a Task is returned by the client.
If the task is circualr the client will call the generate() method to create
additinal tasks.
- Specified by:
isCircular in interface Task
- Following copied from interface:
dcf.server.Task
- Returns:
- true - If the task should create new tasks.
false - If the task ends when returned.
generate
public java.util.Vector generate()
- Description copied from interface:
Task
- If this is a circular task it should generate a vector of new tasks
- Specified by:
generate in interface Task
- Following copied from interface:
dcf.server.Task
- Returns:
- A Vector of new Tasks.
processResults
public void processResults()
- Description copied from interface:
Task
- Called by Distributer when a task is returned.
- Specified by:
processResults in interface Task
setParent
public void setParent(Worker w)
- Description copied from interface:
Task
- Sets the parent for this task.
- Specified by:
setParent in interface Task
- Following copied from interface:
dcf.server.Task
- Parameters:
w - The active Worker for this task.
Distributed Computation Framework