|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectthreadExamples.Queue<V>
V - The type of object that may be put into
this Queue.public class Queue<V>
A synchronized queue. Objects can be put
in the queue and retrieved from it by separate Threads;
a request to get something from this Queue
will wait (block) until there is something to get.
| Constructor Summary | |
|---|---|
Queue()
|
|
| Method Summary | |
|---|---|
V |
get()
Returns an Object from this Queue, waiting indefinitely if necessary for something to be put in this Queue. |
V |
get(int limit)
Returns an Object from this Queue, waiting up to limit
milliseconds, if necessary, for something to be put into this Queue. |
void |
put(V obj)
Adds an object to this Queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Queue()
| Method Detail |
|---|
public void put(V obj)
obj - The object to be added.public V get()
public V get(int limit)
limit
milliseconds, if necessary, for something to be put into this Queue.
If nothing is put into this Queue within the limit, null
is returned.
limit - The number of milliseconds to wait.
null,
if the time limit is exceeded).
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||