API: changed getSubName() to getDestinationName()
[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     /** returns true if this is an inbox */
21     public abstract boolean isInbox();
22
23     /** returns true if this is an outbox */
24     public abstract boolean isOutbox();
25
26     /** get all destinations associated with this BenkoBox; default implementation: just itself */
27     public Iterable<Destination> getDestinations() {
28         HashSet<Destination> self = new HashSet<Destination>();
29         self.add(this);
30         return self;
31     }
32
33     /** default implementation: the empty string */
34     public String getDestinationName() { return ""; }
35
36 }