T - The type of queue for the elements.public interface ObjectQueue<T>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ObjectQueue.Listener<T>
Listens for changes to the queue.
|
| 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.
|
int size()
void add(T entry)
T peek()
null if the queue is empty. Does not modify the
queue.void remove()
void setListener(ObjectQueue.Listener<T> listener)
ObjectQueue.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.Copyright © 2015 Square, Inc.. All Rights Reserved.