Example #1
0
 /**
  * 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();
   }
 }
Example #2
0
 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);
 }
Example #3
0
 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;
 }
Example #4
0
 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);
 }
Example #5
0
 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();
 }