add initial support for virtual destinations
[fleet.git] / src / edu / berkeley / fleet / api / BenkoBox.java
1 package edu.berkeley.fleet.api;
2 import java.util.*;
3
4 public abstract class BenkoBox extends Destination {
5
6     /** you should extend subclasses, not this class directly */
7     //FIXME
8     public BenkoBox() { }
9
10     /** the descriptive name of this benkobox (relative to its ship) */
11     public abstract String getName();
12
13     /** return the Ship to which this BenkoBox belongs */
14     public abstract Ship   getShip();
15
16     /** the maximum number of instructions we can put in the BenkoBox instruction fifo,
17      *  or Integer.MAX_VALUE if unbounded */
18     public abstract int getInstructionFifoLength();
19
20     public static abstract class Inbox extends BenkoBox {
21         public Inbox() { }
22     }
23
24     public static abstract class Outbox extends BenkoBox {
25         public Outbox() { }
26     }
27
28     /** get all destinations associated with this BenkoBox */
29     public Iterable<Destination> getDestinations() {
30         HashSet<Destination> self = new HashSet<Destination>();
31         self.add(this);
32         return self;
33     }
34 }