added remove destination method

This commit is contained in:
fros4943 2006-10-06 13:31:02 +00:00
parent 880b3df797
commit e4611dc912

View File

@ -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;
@ -85,6 +85,20 @@ public class RadioConnection {
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
*/