|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jthomas.util.Queue
This class implements a simple efficient FIFO Queue.
Usage Example: Thread1: Queue myqueue = new Queue(100); myqueue.put("This could be any Object"); Thread2: String x = (String)myqueue.get();Notes:
Constructor Summary | |
Queue()
Queue Constructor. |
|
Queue(int capacity)
Queue Constructor that sets the capacity of the Queue. |
Method Summary | |
java.lang.Object |
get()
Method: get() will return the first object in the Queue. |
void |
put(java.lang.Object obj)
Method: put(Object obj) will place specified object into the FIFO Queue |
java.lang.String |
toString()
Give Debug info |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Queue()
public Queue(int capacity)
Method Detail |
public java.lang.Object get()
If the queue is empty, it will block until a new object arrives.
public void put(java.lang.Object obj)
obj
- An Object that is to be added to the queue.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |