990555d3e13d2651e6b6005d4984653c0e962ddd
[fleet.git] / src / edu / berkeley / fleet / doc / BenkoBoxDescription.java
1 package edu.berkeley.fleet.doc;
2
3 import java.io.*;
4 import java.util.*;
5
6 public class BenkoBoxDescription implements Iterable<String> {
7
8     public String getName() { return name; }
9     public boolean isInbox() { return inbox; }
10     public boolean isOutbox() { return !inbox; }
11     public boolean tokensOnly() { return tokenOnly; }
12     public String  getShortcut() { return shortcut; }
13     public Iterator<String> iterator() { return destinations.iterator(); }
14
15     // private //////////////////////////////////////////////////////////////////////////////
16
17     private final ShipDescription ship;
18     private final String shortcut;
19     private final String name;
20     private final boolean inbox;
21     private final boolean tokenOnly;
22     private ArrayList<String> destinations = new ArrayList<String>();
23
24     BenkoBoxDescription(ShipDescription ship, String name, boolean tokenOnly, boolean inbox) {
25         this(ship, name, tokenOnly, inbox, null);
26     }
27     BenkoBoxDescription(ShipDescription ship, String name, boolean tokenOnly, boolean inbox, String shortcut) {
28         this.ship = ship;
29         this.name = name;
30         this.inbox = inbox;
31         this.tokenOnly = tokenOnly;
32         this.shortcut = shortcut;
33         ship.add(this);
34     }
35
36     void addDest(String dest) { destinations.add(dest); }
37
38 }