|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--CommandQueue
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.
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 |
public CommandQueue()
Method Detail |
public void putCommand(Command c)
c
- a Command to be put into the queue.public Command getCommand()
public boolean isEmpty()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |