better error reporting on invalid instructions
[fleet.git] / src / edu / berkeley / fleet / api / Pump.java
1 package edu.berkeley.fleet.api;
2 import java.util.*;
3
4 public abstract class Pump {
5
6     public Pump() { }
7
8     /** the descriptive name of this pump (relative to its ship) */
9     public abstract String getName();
10
11     /** return the Ship to which this Pump belongs */
12     public abstract Ship   getShip();
13
14     /** the maximum number of instructions we can put in the Pump instruction fifo,
15      *  or Integer.MAX_VALUE if unbounded */
16     public abstract int getInstructionFifoLength();
17
18     /** returns true if this is an inbox */
19     public abstract boolean isInbox();
20
21     /** returns true if this is an outbox */
22     public abstract boolean isOutbox();
23
24     /** get all destinations associated with this Pump; default implementation: just itself */
25     public abstract Iterable<Destination> getDestinations();
26
27     /** default implementation: the empty string */
28     public String getDestinationName() { return ""; }
29
30     /** return the Pump which is the destination of this Box's shortcut (if any) */
31     public Pump getShortcut() { return null; }
32
33     public abstract long resolveLiteral(String literal);
34 }