public class Queue extends Object
| Constructor and Description |
|---|
Queue() |
| Modifier and Type | Method and Description |
|---|---|
Object |
get()
Get an object from the front of the queue.
|
Object |
get(long msecs)
Get an object from the front of the queue.
|
void |
put(Object obj)
Put an object on the end of the queue.
|
boolean |
put(Object obj,
long msecs)
Put an object on the end of the queue.
|
void |
setMaxQueueSize(int newValue)
Set the maximum queue size.
|
public void put(Object obj) throws InterruptedException
obj - the object to put at end of queueInterruptedExceptionpublic boolean put(Object obj, long msecs) throws InterruptedException
obj - the object to put at end of queuemsecs - If this method has to wait for the size of the queue to shrink
to less than maxQueueSize, it will stop waiting after it has
waited this many milliseconds.InterruptedExceptionpublic Object get() throws InterruptedException
InterruptedExceptionpublic Object get(long msecs) throws InterruptedException
msecs - The maximum number of milliseconds that this method should
wait before giving up.InterruptedExceptionpublic void setMaxQueueSize(int newValue)
Copyright © 2014 eXo Platform SAS. All Rights Reserved.