public final class UnmodifiableQueue<E> extends AbstractQueueDecorator<E> implements Unmodifiable
Queue to ensure it can't be altered.
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object
|
boolean |
addAll(Collection
|
void |
clear()
|
Iterator |
iterator()
|
boolean |
offer(E obj)
|
E |
poll()
|
E |
remove()
|
boolean |
remove(Object
|
boolean |
removeAll(Collection
|
boolean |
retainAll(Collection
|
static <E> Queue |
unmodifiableQueue(Queue
Factory method to create an unmodifiable queue.
|
decorated, element, peekcontains, containsAll, isEmpty, setCollection, size, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, isEmpty, parallelStream, removeIf, size, spliterator, stream, toArray, toArraypublic static <E> Queue<E> unmodifiableQueue(Queue <? extends E> queue)
If the queue passed in is already unmodifiable, it is returned.
E - the type of the elements in the queue
queue - the queue to decorate, must not be null
NullPointerException - if queue is null
public boolean add(Objectobject)
public boolean addAll(Collection<? extends E> coll)
public void clear()
public boolean remove(Objectobject)
public boolean removeAll(Collection<?> coll)
public boolean retainAll(Collection<?> coll)
public boolean offer(E obj)
public E poll()
public E remove()