Class CommandQueue

java.lang.Object
  |
  +--CommandQueue

public class CommandQueue
extends java.lang.Object

A class encapsulating a queue of Commands to be processed by the Robot. Commands put into the queue are returned in a first-in-first-out order. Basically, this is a hack using a Hashtable and two keys: an input key used to put Commands into the queue, and an output key to retrieve the Commands out of the queue. If the output key is greater than or equal to the input key, the queue is deemed empty.

See Also:
SimulationEngine, Command

Constructor Summary
CommandQueue()
          Creates and initializes a new queue.
 
Method Summary
 Command getCommand()
          Retrieves the next Command from the FIFO queue.
 boolean isEmpty()
          Returns true if the CommandQueue object is empty.
 void putCommand(Command c)
          Adds a Command into the FIFO queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandQueue

public CommandQueue()
Creates and initializes a new queue.
Method Detail

putCommand

public void putCommand(Command c)
Adds a Command into the FIFO queue.
Parameters:
c - a Command to be put into the queue.

getCommand

public Command getCommand()
Retrieves the next Command from the FIFO queue.
Returns:
the next Command in the queue.

isEmpty

public boolean isEmpty()
Returns true if the CommandQueue object is empty.
Returns:
indicates if the CommandQueue is empty.