6a012972eebfa72d962e31a051e93e30c0e092fa
[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 Iterator<String> iterator() { return destinations.iterator(); }
13
14     // private //////////////////////////////////////////////////////////////////////////////
15
16     private final ShipDescription ship;
17     private final String name;
18     private final boolean inbox;
19     private final boolean tokenOnly;
20     private ArrayList<String> destinations = new ArrayList<String>();
21
22     BenkoBoxDescription(ShipDescription ship, String name, boolean tokenOnly, boolean inbox) {
23         this.ship = ship;
24         this.name = name;
25         this.inbox = inbox;
26         this.tokenOnly = tokenOnly;
27         ship.add(this);
28     }
29
30     void addDest(String dest) { destinations.add(dest); }
31
32 }