public class GenericQueue extends Object
| Constructor and Description |
|---|
GenericQueue()
Create an empty queue
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Clear a queue
|
Object |
get()
Retrieve an object from the head of the queue, or block until one
arrives.
|
Object |
get(long timeout)
Retrieve an object from the head of the queue, blocking until one arrives
or until timeout occurs.
|
int |
getCount() |
void |
put(Object o)
Add an object to the tail of the queue.
|
Object |
tryGet() |
public void flush()
public void close()
public void put(Object o)
o - Object to insert in the queuepublic Object get()
public Object get(long timeout) throws InterruptedException
timeout - Maximum time to block on queue, in ms. Use 0 to poll the
queue.InterruptedException - if the operation times out.public Object tryGet()
public int getCount()
Copyright © 2020. All rights reserved.