Package com.zendesk.connect
Interface BaseQueue<T>
-
public interface BaseQueue<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
add(T object)
Adds an object to the queuevoid
clear()
Removes all objects from the queueT
peek()
Gets the first item from the queue, or null if the queue is emptyjava.util.List<T>
peek(int max)
Gets the first n items from the queue, or all if there are less than n itemsvoid
remove(int max)
Removes n objects from the queue, or all if there are less than n itemsint
size()
Gets the current queue size
-
-
-
Method Detail
-
add
void add(T object)
Adds an object to the queue- Parameters:
object
- the object to be added to the queue
-
size
int size()
Gets the current queue size- Returns:
- the size of the queue
-
peek
T peek()
Gets the first item from the queue, or null if the queue is empty- Returns:
- the first item from the queue, or null
-
peek
java.util.List<T> peek(int max)
Gets the first n items from the queue, or all if there are less than n items- Parameters:
max
- the maximum number of items to return- Returns:
- the list of items retrieved from the queue
-
remove
void remove(int max)
Removes n objects from the queue, or all if there are less than n items- Parameters:
max
- the maximum number of items to return
-
clear
void clear()
Removes all objects from the queue
-
-