added Destination.getSubName()
authoradam <adam@megacz.com>
Mon, 19 Feb 2007 14:05:27 +0000 (15:05 +0100)
committeradam <adam@megacz.com>
Mon, 19 Feb 2007 14:05:27 +0000 (15:05 +0100)
src/edu/berkeley/fleet/api/BenkoBox.java
src/edu/berkeley/fleet/api/Destination.java

index 5a3d9dd..cd93a16 100644 (file)
@@ -25,10 +25,14 @@ public abstract class BenkoBox extends Destination {
         public Outbox() { }
     }
 
-    /** get all destinations associated with this BenkoBox */
+    /** get all destinations associated with this BenkoBox; default implementation: just itself */
     public Iterable<Destination> getDestinations() {
         HashSet<Destination> self = new HashSet<Destination>();
         self.add(this);
         return self;
     }
+
+    /** default implementation: the empty string */
+    public String getSubName() { return ""; }
+
 }            
index 8bf7270..6a2ab7f 100644 (file)
@@ -7,4 +7,6 @@ public abstract class Destination {
     /** return the Ship to which this BenkoBox belongs */
     public abstract Ship   getShip();
 
+    /** this returns the third component of the name; that is in "ship.port.foo", it returns "foo" */
+    public abstract String getSubName();
 }