1 package edu.berkeley.fleet.interpreter.ships;
2 import edu.berkeley.fleet.interpreter.*;
3 import edu.berkeley.fleet.*;
8 public class Dup extends InterpreterShip {
10 DataInbox in = new DataInbox(this, "in");
11 DataOutbox a = new DataOutbox(this, "a");
12 DataOutbox b = new DataOutbox(this, "b");
14 public String getBalsaName() { return "dup"; }
16 public Dup (Interpreter fleet, String name) {
20 public void service() {
21 if (in.dataReadyForShip() && a.readyForDataFromShip() && b.readyForDataFromShip()) {
22 int data = in.removeDataForShip();
23 a.addDataFromShip(data);
24 b.addDataFromShip(data);