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