removeDestination(Mote) method returns true is the argument mote was actually a destination (and hence was removed)

This commit is contained in:
fros4943 2009-11-13 08:38:45 +00:00
parent a9eecb03df
commit 499c3b8c26
1 changed files with 6 additions and 5 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: RadioConnection.java,v 1.10 2009/05/26 13:37:26 fros4943 Exp $ * $Id: RadioConnection.java,v 1.11 2009/11/13 08:38:45 fros4943 Exp $
*/ */
package se.sics.cooja; package se.sics.cooja;
@ -119,16 +119,17 @@ public class RadioConnection {
/** /**
* Removes destination radio. * Removes destination radio.
* *
* @param radio * @param radio Radio
* Radio * @return True if radio was removed
*/ */
public void removeDestination(Radio radio) { public boolean removeDestination(Radio radio) {
int idx = destinations.indexOf(radio); int idx = destinations.indexOf(radio);
if (idx < 0) { if (idx < 0) {
return; return false;
} }
destinations.remove(idx); destinations.remove(idx);
destinationDelays.remove(idx); destinationDelays.remove(idx);
return true;
} }
/** /**