T - the type of objects stored in this queue.public interface CarbonQueue<T>
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Method to clear this queue.
|
T |
get(int index)
Method to retrieve the element at the given index of this queue.
|
int |
indexOf(T element)
This method returns the index of the given element on this queue.
|
boolean |
isEmpty()
Method to test whether this queue is empty.
|
T |
peek()
Retrieves, but does not remove, the head of this queue.
|
List<T> |
peek(int count)
Retrieves, but does not remove, the given number of items from the top, which also includes
the head of this queue.
|
T |
pop()
Retrieves and removes, the head of this queue.
|
List<T> |
pop(int count)
Retrieves and removes, the given number of items from the top, which also includes the head
of this queue.
|
void |
push(List<T> elements)
Adds the given elements onto the queue.
|
void |
push(T element)
Adds the given element onto the queue.
|
int |
size()
Method to obtain the size of this queue.
|
T peek() throws QueueEmptyException
QueueEmptyException - when this queue is empty.List<T> peek(int count) throws QueueEmptyException
count - the number of items to return.QueueEmptyException - when this queue is empty.T pop() throws QueueEmptyException
QueueEmptyException - when this queue is empty.List<T> pop(int count) throws QueueEmptyException
count - the number of items to return.QueueEmptyException - when this queue is empty.void push(T element)
element - the element to add.void push(List<T> elements)
elements - the elements to add.int size()
boolean isEmpty()
void clear()
int indexOf(T element) throws QueueEmptyException
element - the element.QueueEmptyException - when this queue is empty.T get(int index)
index - the index of the element.Copyright © 2018 WSO2 Inc. All rights reserved.