T - The type of elements in the queue.public class InMemoryObjectQueue<T> extends Object implements ObjectQueue<T>
ObjectQueue.Listener<T>| Constructor and Description |
|---|
InMemoryObjectQueue() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T entry)
Enqueues an entry that can be processed at any time.
|
T |
peek()
Returns the head of the queue, or
null if the queue is empty. |
void |
remove()
Removes the head of the queue.
|
void |
setListener(ObjectQueue.Listener<T> listener)
Sets a listener on this queue.
|
int |
size()
Returns the number of entries in the queue.
|
public void add(T entry)
ObjectQueueadd in interface ObjectQueue<T>public T peek()
ObjectQueuenull if the queue is empty. Does not modify the
queue.peek in interface ObjectQueue<T>public int size()
ObjectQueuesize in interface ObjectQueue<T>public void remove()
ObjectQueueremove in interface ObjectQueue<T>public void setListener(ObjectQueue.Listener<T> listener)
ObjectQueueObjectQueue.Listener.onAdd(com.squareup.tape.ObjectQueue<T>, T) once for each entry that's
already in the queue. If an error occurs while reading the data, the listener will not receive
further notifications.setListener in interface ObjectQueue<T>Copyright © 2015 Square, Inc.. All Rights Reserved.