|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectshoddybattle.util.ThreadedQueue
public class ThreadedQueue
Java 1.5 has this built in as java.util.BlockingQueue, but the version we are using - 1.4 - does not. Here I roll my own simple version.
Nested Class Summary | |
---|---|
static interface |
ThreadedQueue.QueueDelegate
Callback used to handle items in the queue as they are pulled off. |
Constructor Summary | |
---|---|
ThreadedQueue(ThreadedQueue.QueueDelegate delegate)
Creates a new instance of ThreadedQueue. |
Method Summary | |
---|---|
void |
finalize()
Just in case we forget to stop the queue, this method will save us. |
void |
post(java.lang.Object o)
Post a message to the threaded queue. |
void |
start()
Start the threaded queue. |
void |
stop()
Stop the threaded queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadedQueue(ThreadedQueue.QueueDelegate delegate)
delegate
- object to invoke for each item in the queueMethod Detail |
---|
public void start()
public void stop()
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void post(java.lang.Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |