skeleton
Class Pipeline

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

public class Pipeline
extends Compute

This is the pipeline skeleton class. The muskel pipeline is a two stage pipeline. Multiple stage pipelines can be defined nesting two stage pipelines. That is, provided that StageX are all skeletons (i.e. they implement the Compute interface) the following code represents a three stage pipeline:

 Pipeline p1 = new Pipeline(Stage1, Stage2);
 Pipeline main = new Pipeline(p1, Stage3);
 
This is for the sake of simplicity. There is no problem in implementing an n-stage pipeline, using a Vector of stages instead of a fixed set of variables hosting the stages.

See Also:
Serialized Form

Constructor Summary
Pipeline(Compute stage1, Compute stage2)
          constructs a two stage pipeline
 
Method Summary
 java.lang.Object compute(java.lang.Object task)
          computes the pipeline sequentially.
 Compute getFirstStage()
          this returns the first stage, used in the MDF conpiler
 Compute getSecondStage()
          this returns the second stage, used in the MDF compiler
 
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

Pipeline

public Pipeline(Compute stage1,
                Compute stage2)
constructs a two stage pipeline

Parameters:
stage1 - is the skeleton representing the computation to be performed at the first stage
stage2 - is the skeleton representing the computation to be performed at the second stage
Method Detail

getFirstStage

public Compute getFirstStage()
this returns the first stage, used in the MDF conpiler

Returns:

getSecondStage

public Compute getSecondStage()
this returns the second stage, used in the MDF compiler

Returns:

compute

public java.lang.Object compute(java.lang.Object task)
computes the pipeline sequentially.

Specified by:
compute in class Compute
Parameters:
task - is the data input to be processed by the pipeline
Returns:
the result computed by the pipeline as an Object