|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.proactive.p2p.api.problem.Problem
Implement this class to solve a divide&conquer problem.
Field Summary | |
protected Worker |
worker
|
Constructor Summary | |
Problem()
|
|
Problem(Worker worker)
|
Method Summary | |
abstract Result |
execute(java.lang.Object[] params)
Work of the task. |
abstract Result |
gather(Result[] results)
To merge all results from daughters tasks when they finish their works. |
Result |
getCurrentResult()
|
void |
setWorker(Worker worker)
|
abstract int |
shouldSplit()
If retun 1 split() is called also split(n) with
n is the return is called. |
abstract Problem |
split()
To split this task in a daughter task. |
Problem[] |
split(int n)
To split this task in n daughters tasks. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Worker worker
Constructor Detail |
public Problem()
public Problem(Worker worker)
Method Detail |
public abstract Result execute(java.lang.Object[] params)
params
-
public abstract Problem split()
public Problem[] split(int n)
n
daughters tasks.
n
- Number of daughters tasks.
public abstract Result gather(Result[] results)
results
- All results.
public abstract int shouldSplit()
split()
is called also split(n)
with
n is the return is called. To do nothing please return 0.
public Result getCurrentResult()
public void setWorker(Worker worker)
worker
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |