|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.CommandQueue
a simple queue data structure used to manager simulator commands. This class realizes a queue data structure used to hold (interactive) simulator commands (e.g. pauseSimulation). It is implemented using a doubly-linked list with root node, and it synchronizes all accessor method to provide a thread-safe (if possible deadlocking) ordering of queue entries.
Nested Class Summary | |
(package private) class |
CommandQueue.SelftestFeeder
|
(package private) class |
CommandQueue.SelftestFetcher
|
Constructor Summary | |
CommandQueue()
constructor for an empty command queue. |
Method Summary | |
void |
append(java.lang.Object o)
append data to the end of this queue |
int |
countAppends()
|
int |
countFetches()
|
java.lang.Object |
fetch()
|
void |
first()
set the cursor to the first node of this list |
java.lang.Object |
getData()
get data of the cursor node |
boolean |
isEmpty()
is this list empty? |
void |
last()
set the cursor to the last node of this list |
static void |
main(java.lang.String[] argv)
main(): simple self test |
void |
next()
move the cursor to the next node, if any |
void |
prev()
move the cursor to the previous node, if any |
void |
setData(java.lang.Object o)
set data of the cursor node |
java.lang.String |
toString()
dump text rep of queue |
static void |
usage()
usage(): how to use the CommandQueue selftest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CommandQueue()
Method Detail |
public void first()
public final void last()
public final void next()
public final void prev()
public final java.lang.Object getData()
public final void setData(java.lang.Object o)
public void append(java.lang.Object o)
public java.lang.Object fetch()
public boolean isEmpty()
public int countAppends()
public int countFetches()
public java.lang.String toString()
public static void usage()
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |