|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsync.Queue
First-In First-Out queue for synchronizing data exchange between several threads. For example, producer/consumer problem can be implemented by means of this queue.
Constructor Summary | |
Queue()
|
Method Summary | |
java.lang.Object |
get()
Wait until queue is not empty and take object from the queue. |
java.lang.Object |
get(long timeout)
Wait at most timeout miliseconds until queue becomes
not empty and take object from the queue. |
boolean |
isEmpty()
Check if queue is empty. |
void |
put(java.lang.Object obj)
Put object in queue. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Queue()
Method Detail |
public void put(java.lang.Object obj)
public java.lang.Object get()
public java.lang.Object get(long timeout)
timeout
miliseconds until queue becomes
not empty and take object from the queue.
timeout
- the maximum time to wait in milliseconds.
null
otherwisepublic boolean isEmpty()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |