Unmodifiable
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 | Description |
---|---|---|
boolean |
add(java.lang.Object object) |
|
boolean |
addAll(java.util.Collection<? extends E> coll) |
|
void |
clear() |
|
java.util.Iterator<E> |
iterator() |
|
boolean |
offer(E obj) |
|
E |
poll() |
|
E |
remove() |
|
boolean |
remove(java.lang.Object object) |
|
boolean |
removeAll(java.util.Collection<?> coll) |
|
boolean |
retainAll(java.util.Collection<?> coll) |
|
static <E> java.util.Queue<E> |
unmodifiableQueue(java.util.Queue<? extends E> queue) |
Factory method to create an unmodifiable queue.
|
contains, containsAll, isEmpty, setCollection, size, toArray, toArray, toString
decorated, element, peek
public static <E> java.util.Queue<E> unmodifiableQueue(java.util.Queue<? extends E> queue)
If the queue passed in is already unmodifiable, it is returned.
E
- the type of the elements in the queuequeue
- the queue to decorate, must not be nulljava.lang.NullPointerException
- if queue is nullpublic java.util.Iterator<E> iterator()
iterator
in class AbstractCollectionDecorator<E>
public boolean add(java.lang.Object object)
add
in class AbstractCollectionDecorator<E>
public boolean addAll(java.util.Collection<? extends E> coll)
addAll
in class AbstractCollectionDecorator<E>
public void clear()
clear
in class AbstractCollectionDecorator<E>
public boolean remove(java.lang.Object object)
remove
in class AbstractCollectionDecorator<E>
public boolean removeAll(java.util.Collection<?> coll)
removeAll
in class AbstractCollectionDecorator<E>
public boolean retainAll(java.util.Collection<?> coll)
retainAll
in class AbstractCollectionDecorator<E>
public boolean offer(E obj)
offer
in class AbstractQueueDecorator<E>
public E poll()
poll
in class AbstractQueueDecorator<E>
public E remove()
remove
in class AbstractQueueDecorator<E>
Copyright © 2001-2019 - Apache Software Foundation