From e4611dc9124c496d82bd2dc742bb763054e9cc90 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Fri, 6 Oct 2006 13:31:02 +0000 Subject: [PATCH] added remove destination method --- .../java/se/sics/cooja/RadioConnection.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/cooja/java/se/sics/cooja/RadioConnection.java b/tools/cooja/java/se/sics/cooja/RadioConnection.java index 63b4c6524..71e17b12a 100644 --- a/tools/cooja/java/se/sics/cooja/RadioConnection.java +++ b/tools/cooja/java/se/sics/cooja/RadioConnection.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: RadioConnection.java,v 1.1 2006/08/21 12:12:55 fros4943 Exp $ + * $Id: RadioConnection.java,v 1.2 2006/10/06 13:31:02 fros4943 Exp $ */ package se.sics.cooja; @@ -84,6 +84,20 @@ public class RadioConnection { destinationPositions.add(position); destinationData.add(data); } + + /** + * Remove a connection destination. + * + * @param radio Destination to remove + */ + public void removeDestination(Radio radio) { + int pos = destinationRadios.indexOf(radio); + if (pos > 0) { + destinationRadios.remove(pos); + destinationPositions.remove(pos); + destinationData.remove(pos); + } + } /** * @return Source radio