Queue to ensure it can't be altered.
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| private | UnmodifiableQueue(final Queue<? extends E>
the queue to decorate, must not be null queue)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(final Object
the element to add object)Overrides org. Implements java. true upon success and throwing an IllegalStateException
if no space is currently available.
|
| public boolean | addAll(final Collection<? extends E>
collection containing elements to be added to this collection coll)Overrides org. Implements java. |
| public void | clear()
Overrides org. Implements java. |
| public Iterator | iterator()
Overrides org. Implements java. |
| public boolean | offer(final E
the element to add obj)Overrides org. Implements java. |
| public E | poll()
Overrides org. Implements java. null if this queue is empty.
|
| private void | readObject(final ObjectInputStream
the input stream in)Read the collection in using a custom routine. |
| public boolean | remove(final Object
element to be removed from this collection, if present object)Overrides org. Implements java. |
| public E | remove()
Overrides org. Implements java. |
| public boolean | removeAll(final Collection<?>
collection containing elements to be removed from this collection coll)Overrides org. Implements java. |
| public boolean | removeIf(Predicate<? super E>
a predicate which returns filter)true for elements to be
removedOverrides org. Overrides default java. |
| public boolean | retainAll(final Collection<?>
collection containing elements to be retained in this collection coll)Overrides org. Implements java. |
| public static < the type of the elements in the queue E> Queue | Returns: an unmodifiable Queuethe queue to decorate, must not be null queue)Factory method to create an unmodifiable queue. |
| private void | writeObject(final ObjectOutputStream
the output stream out)Write the collection out using a custom routine. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| UnmodifiableQueue | back to summary |
|---|---|
| private UnmodifiableQueue(final Queue<? extends E> queue) Constructor that wraps (not copies).
| |
| add | back to summary |
|---|---|
| public boolean add(final Object object) Overrides org. Implements java. Doc from java. Inserts the specified element into this queue if it is possible to do so
immediately without violating capacity restrictions, returning
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(final Collection<? extends E> coll) Overrides org. Implements java. Doc from java. Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.) If the specified collection has a defined encounter order, processing of its elements generally occurs in that order.
| |
| clear | back to summary |
|---|---|
| public void clear() Overrides org. Implements java. Doc from java. Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns.
| |
| iterator | back to summary |
|---|---|
| public Iterator Overrides org. Implements java. Doc from java. Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned (unless this collection is an instance of some class that provides a guarantee). | |
| offer | back to summary |
|---|---|
| public boolean offer(final E obj) Overrides org. Implements java. Doc from java. Inserts the specified element into this queue if it is possible to do
so immediately without violating capacity restrictions.
When using a capacity-restricted queue, this method is generally
preferable to
| |
| poll | back to summary |
|---|---|
| public E poll() Overrides org. Implements java. Doc from java. Retrieves and removes the head of this queue,
or returns
| |
| readObject | back to summary |
|---|---|
| private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException Read the collection in using a custom routine.
| |
| remove | back to summary |
|---|---|
| public boolean remove(final Object object) Overrides org. Implements java. Doc from java. Removes a single instance of the specified element from this
collection, if it is present (optional operation). More formally,
removes an element | |
| remove | back to summary |
|---|---|
| public E remove() Overrides org. Implements java. Doc from java. Retrieves and removes the head of this queue. This method differs
from
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(final Collection<?> coll) Overrides org. Implements java. Doc from java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
| |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(Predicate<? super E> filter) Overrides org. Overrides default java. Doc from java. Removes all of the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller. | |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(final Collection<?> coll) Overrides org. Implements java. Doc from java. Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
| |
| unmodifiableQueue | back to summary |
|---|---|
| public static <E> Queue Factory method to create an unmodifiable queue. If the queue passed in is already unmodifiable, it is returned.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(final ObjectOutputStream out) throws IOException Write the collection out using a custom routine.
| |