Out Next: Follow ProcessUp: Reactive ProcessesPrevious: Integer List

Out

Out  prints its input (considered as a channel of long values).

public class Out extends ReactiveProcess
{
  private Channel in;

  public Out(Channel in){ this.in = in; }

  public Out(NrpMachine machine,String in){ 
    this.in = machine.getChannel(in); 
    machine.add(this);
  }

  final public String toString(){ return "out(" + in + ")"; }

  protected byte activation(Machine machine)
  {
    byte b = fix(in,machine);
    if (b == TERM){
      long i = ((Number)in.get()).longValue();
      System.out.println(i);
      return STOP;
    }
    return b;
  }