skeleton
Class Farm

java.lang.Object
  extended by skeleton.Compute
      extended by skeleton.Farm
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Farm
extends Compute

This is the "emabarassingly parallel" skeleton. Each task supplied to the Farm is actually computed independently of the other tasks by invoking the compute method of the inner skeleton (alias the worker).

See Also:
Serialized Form

Constructor Summary
Farm(Compute worker)
          creates a new Farm skeleton.
 
Method Summary
 java.lang.Object compute(java.lang.Object task)
          computes a task sequentially.
 Compute getWorker()
          this is only needed to compiler into MDF
 
Methods inherited from class skeleton.Compute
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Farm

public Farm(Compute worker)
creates a new Farm skeleton.

Parameters:
worker - is the skeleton used to implement the Farm workers, i.e. it is the skeleton modelling the computation that has to be independently performed on each one of the tasks submitted to the Farm.
Method Detail

getWorker

public Compute getWorker()
this is only needed to compiler into MDF

Returns:
the worker code

compute

public java.lang.Object compute(java.lang.Object task)
computes a task sequentially.

Specified by:
compute in class Compute
Parameters:
task - the input data to be processed
Returns:
the result of the computation, as an Objects