From c9d0041d5db1de1a88414ee2c770f3b7cf357ee2 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 19 Feb 2007 15:05:27 +0100 Subject: [PATCH] added Destination.getSubName() --- src/edu/berkeley/fleet/api/BenkoBox.java | 6 +++++- src/edu/berkeley/fleet/api/Destination.java | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/edu/berkeley/fleet/api/BenkoBox.java b/src/edu/berkeley/fleet/api/BenkoBox.java index 5a3d9dd..cd93a16 100644 --- a/src/edu/berkeley/fleet/api/BenkoBox.java +++ b/src/edu/berkeley/fleet/api/BenkoBox.java @@ -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 getDestinations() { HashSet self = new HashSet(); self.add(this); return self; } + + /** default implementation: the empty string */ + public String getSubName() { return ""; } + } diff --git a/src/edu/berkeley/fleet/api/Destination.java b/src/edu/berkeley/fleet/api/Destination.java index 8bf7270..6a2ab7f 100644 --- a/src/edu/berkeley/fleet/api/Destination.java +++ b/src/edu/berkeley/fleet/api/Destination.java @@ -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(); } -- 1.7.10.4