added am10 inbox/outbox support
[fleet.git] / src / edu / berkeley / fleet / Port.java
1 package edu.berkeley.fleet;
2
3 /** a destination on the switch fabric */
4 public abstract class Port {
5         
6     public final String name;
7     public final Ship ship;
8         
9     public Port(Ship ship, String name) {
10         this.ship = ship;
11         this.name = name;
12         ship.addPort(name, this);
13     }
14
15     public void service() { }
16         
17     /** adds one token to the port */
18     public abstract void addToken();
19         
20     /** adds the included datum to the port */
21     public abstract void addData(int datum);
22
23     public Ship getShip() {
24         return ship;
25     }
26
27     public String toString() { return ship+"."+name; }
28
29 }