Sum Process Next: ExamplesUp: Reactive ProcessesPrevious: Binary Functions

Sum Process

The Sum  extends BinaryFunction with the addition function defined for long parameters.

public class Sum extends BinaryFunction
{
  public Sum(Channel left,Channel right,Channel out){ 
     super(left,right,out); 
  }

  public Sum(NrpMachine machine,
                String left,String right,String out){ 
     super(machine,left,right,out); 
  }

  final public String toString(){ 
    return "sum(" + out + "," + left + "," + right + ")";
  }


  final protected Object fun(Object arg1,Object arg2){
     return new Long(

         ((Number)arg1).longValue()+((Number)arg2).longValue());
  }
}