FPGA-Fleet updates
[fleet.git] / src / edu / berkeley / fleet / slipway / SlipwayBenkoBox.java
index 322c9dc..aa43e0b 100644 (file)
@@ -8,10 +8,10 @@ public class SlipwayBenkoBox extends BenkoBox {
         
     private final String name;
     private final SlipwayShip ship;
-    private final Destination[] ports;
+    private  Destination[] ports;
         
     public Iterable<Destination> getDestinations() {
-        HashSet<Destination> ret = new HashSet<Destination>();
+        ArrayList<Destination> ret = new ArrayList<Destination>();
         for(Destination d : ports) ret.add(d);
         return ret;
     }
@@ -55,6 +55,12 @@ public class SlipwayBenkoBox extends BenkoBox {
         ship.addBenkoBox(name, this);
     }
 
+    public void addDestination(String dest) {
+        Destination[] newports = new Destination[ports.length+1];
+        System.arraycopy(ports, 0, newports, 0, ports.length);
+        newports[newports.length-1] = new VirtualPort(dest);
+        ports = newports;
+    }
 
     public class VirtualPort extends Destination {
         public String name;