/** * Runs all commands that have been added to this command group in the order they have been added. * To understand how they are run, see the documentation of {@link * CommandGroup#addSequential(edu.ATA.command.Command) addSequential(Command)} and {@link * CommandGroup#addConcurrent(edu.ATA.command.Command) addConcurrent(Command)}. */ public final void run() { Iterator i = commands.iterator(); while (i.hasNext()) { Command c = (Command) i.next(); c.run(); } }
public Object get(String name) throws InternalNotFoundException { Iterator i = list.iterator(); while (i.hasNext()) { Node n = (Node) i.next(); if (n.name.equals(name)) { return n.object; } } throw new InternalNotFoundException(name); }
public boolean contains(String name) { Iterator i = list.iterator(); while (i.hasNext()) { Node n = (Node) i.next(); if (n.name.equals(name)) { return true; } } return false; }
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); }
public Object[] getAll(String name) { Iterator i = list.iterator(); List l = new ArrayList(); while (i.hasNext()) { Node n = (Node) i.next(); if (n.name.equals(name)) { l.add(n.object); } } return l.toArray(); }