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
- ObjectInterruptedException
public void put(Object o, int timeout) throws InterruptedException
timeout
- If timeout expires, throw InterruptedExceptiono
- ObjectInterruptedException
- Timeout expired or otherwise interruptedpublic Object get() throws InterruptedException
InterruptedException
public Object get(int timeoutMs) throws InterruptedException
timeoutMs
- the time to wait for a jobInterruptedException
public Object peek() throws InterruptedException
InterruptedException
public Object peek(int timeoutMs) throws InterruptedException
timeoutMs
- the time to wait for a jobInterruptedException
Copyright © 2013. All Rights Reserved.