E
- the element typepublic interface Queue<E> extends Collection<E>
Modifier and Type | Field and Description |
---|---|
static int |
UNLIMITED_MAXIMUM_SIZE
Unlimited maximum queue size identifier.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E obj)
Enqueue an object onto the queue.
|
E |
getBack()
Get the object at the back of the queue.
|
E |
getFront()
Get the object at the front of the queue.
|
int |
getMaximumSize()
Get the maximum size of the queue.
|
boolean |
isEmpty()
Check if the queue is empty.
|
boolean |
isFull()
Check if the queue is full.
|
E |
remove()
Dequeue an object from the queue.
|
void |
setMaximumSize(int size)
Set the maximum size of the queue.
|
addAll, clear, contains, containsAll, equals, hashCode, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
static final int UNLIMITED_MAXIMUM_SIZE
int getMaximumSize()
UNLIMITED_MAXIMUM_SIZE
.void setMaximumSize(int size) throws IllegalArgumentException
size
- New maximim pool size or UNLIMITED_MAXIMUM_SIZE
.IllegalArgumentException
- Illegal size.boolean isFull()
boolean isEmpty()
isEmpty
in interface Collection<E>
boolean add(E obj) throws FullCollectionException
add
in interface Collection<E>
obj
- Object to enqueue.FullCollectionException
- The queue is full.E remove() throws EmptyCollectionException
EmptyCollectionException
- The queue is empty.E getFront() throws EmptyCollectionException
EmptyCollectionException
- The queue is empty.E getBack() throws EmptyCollectionException
EmptyCollectionException
- The queue is empty.Copyright © 2018 JBoss by Red Hat. All rights reserved.