* or Integer.MAX_VALUE if unbounded */
public abstract int getInstructionFifoLength();
- public static abstract class Inbox extends BenkoBox {
- public Inbox() { }
- }
+ /** returns true if this is an inbox */
+ public abstract boolean isInbox();
- public static abstract class Outbox extends BenkoBox {
- public Outbox() { }
- }
+ /** returns true if this is an outbox */
+ public abstract boolean isOutbox();
/** get all destinations associated with this BenkoBox; default implementation: just itself */
public Iterable<Destination> getDestinations() {
boolean needcomma = false;
if (tokenIn) { ret += (needcomma ? ", " : "") + "wait"; needcomma = true; }
if (dataIn && latch) {
- if (benkoBox instanceof BenkoBox.Inbox)
+ if (benkoBox.isInbox())
ret += (needcomma ? ", " : "") + "receive";
else
ret += (needcomma ? ", " : "") + "take";
}
if (dataIn && !latch) { ret += (needcomma ? ", " : "") + "dismiss"; needcomma = true; }
if (dataOut) {
- if (benkoBox instanceof BenkoBox.Inbox || dest==null)
+ if (benkoBox.isInbox() || dest==null)
ret += (needcomma ? ", " : "") + "deliver";
else
ret += (needcomma ? ", " : "") + "sendto "+dest;