Groovy Documentation

gpars
Class AbstractForkJoinWorker

java.lang.Object
  jsr166y.forkjoin.ForkJoinTask
      jsr166y.forkjoin.RecursiveTask
          gpars.AbstractForkJoinWorker

@SuppressWarnings({"AbstractClassWithOnlyOneDirectInheritor", "CollectionWithoutInitialCapacity"})
class AbstractForkJoinWorker
extends jsr166y.forkjoin.RecursiveTask

Implements the ForkJoin worker contract. Subclasses need to implement the compute() to perform the actual Fork/Join algorithm leveraging the options provided by the AbstractForkJoinWorker class. The AbstractForJoinWorker class takes care of the child sub-processes.

Author: Vaclav Pech Date: Nov 1, 2009


Constructor Summary
protected AbstractForkJoinWorker()

 
Method Summary
protected T compute()

protected T computeTask()

protected void forkOffChild(AbstractForkJoinWorker child)

Forks a child task.

protected List getChildrenResults()

Waits for and returns the results of the child tasks.

 
Methods inherited from class jsr166y.forkjoin.RecursiveTask
exec, finish, rawResult, forkJoin, finishExceptionally, reinitialize, getException, join, fork, cancel, isCancelled, isDone, isStolen, quietlyJoin, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 
Methods inherited from class jsr166y.forkjoin.ForkJoinTask
getException, join, exec, finish, fork, cancel, isCancelled, isDone, rawResult, forkJoin, finishExceptionally, reinitialize, isStolen, quietlyJoin, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

AbstractForkJoinWorker

protected AbstractForkJoinWorker()


 
Method Detail

compute

@Override
protected final T compute()


computeTask

protected T computeTask()


forkOffChild

protected final void forkOffChild(AbstractForkJoinWorker child)
Forks a child task. Makes sure it has a means to indicate back completion. The worker is stored in the internal list of workers for evidence and easy result retrieval through getChildrenResults().
param:
child The child task


getChildrenResults

protected final List getChildrenResults()
Waits for and returns the results of the child tasks.
return:
A list of results returned from the child tasks


 

Groovy Documentation