T - The type of tasks in the queue.public class TaskQueue<T extends Task> extends Object implements ObjectQueue<T>
ObjectQueue.Listener<T>| Constructor and Description |
|---|
TaskQueue(ObjectQueue<T> delegate) |
TaskQueue(ObjectQueue<T> delegate,
TaskInjector<T> taskInjector) |
| 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 TaskQueue(ObjectQueue<T> delegate)
public TaskQueue(ObjectQueue<T> delegate, TaskInjector<T> taskInjector)
public T peek()
null if the queue is empty. Does not modify the
queue.
Overridden to inject members into Tasks.peek in interface ObjectQueue<T extends Task>public int size()
ObjectQueuesize in interface ObjectQueue<T extends Task>public void add(T entry)
ObjectQueueadd in interface ObjectQueue<T extends Task>public void remove()
ObjectQueueremove in interface ObjectQueue<T extends Task>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 extends Task>Copyright © 2015 Square, Inc.. All Rights Reserved.