public void removeAll(String name) { for (int x = 0; x < list.size(); x++) { if (((Node) list.get(x)).name.equals(name)) { // goes backwards to check next element list.remove(x--); } } }
public void remove(String name) throws InternalNotFoundException { Iterator i = list.iterator(); while (i.hasNext()) { Node n = (Node) i.next(); if (n.name.equals(name)) { list.remove(n); return; } } throw new InternalNotFoundException(name); }