public class BlockingQueue extends Object
| Constructor and Description |
|---|
BlockingQueue(int maxSize)
Constructor.
|
BlockingQueue(Object lock,
int maxSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
Object |
get()
Get object from queue.
|
Object |
get(int timeoutMs)
Get from queue.
|
int |
maxSize() |
Object |
peek()
Peek at the queue.
|
Object |
peek(int timeoutMs)
Peek at the queue.
|
void |
put(Object o)
Put object in queue.
|
void |
put(Object o,
int timeout)
Put object in queue.
|
int |
size() |
public BlockingQueue(int maxSize)
public BlockingQueue(Object lock, int maxSize)
public void clear()
public int size()
public int maxSize()
public void put(Object o) throws InterruptedException
o - ObjectInterruptedExceptionpublic void put(Object o, int timeout) throws InterruptedException
timeout - If timeout expires, throw InterruptedExceptiono - ObjectInterruptedException - Timeout expired or otherwise interruptedpublic Object get() throws InterruptedException
InterruptedExceptionpublic Object get(int timeoutMs) throws InterruptedException
timeoutMs - the time to wait for a jobInterruptedExceptionpublic Object peek() throws InterruptedException
InterruptedExceptionpublic Object peek(int timeoutMs) throws InterruptedException
timeoutMs - the time to wait for a jobInterruptedExceptionCopyright © 2014. All rights reserved.