A removeComponent() method, used in Cooja to avoid poping up an additional window for the stack UI

This commit is contained in:
Adam Dunkels 2013-01-07 14:38:34 +01:00
parent 25855fe2fe
commit 5b84bc09f1
1 changed files with 15 additions and 0 deletions

View File

@ -71,6 +71,21 @@ public class ComponentRegistry {
return null;
}
public synchronized boolean removeComponent(String name) {
ComponentEntry rem = null;
for (ComponentEntry entry : components) {
if (name.equals(entry.name)) {
rem = entry;
break;
}
}
if (rem == null) {
return false;
}
components.remove(rem);
return true;
}
public synchronized Object[] getAllComponents(String name) {
ArrayList<Object> list = new ArrayList<Object>();
for (ComponentEntry entry : components) {