Top Description Constructors Methods
org.pcollections

public abstract Class AbstractUnmodifiableQueue<E>

extends AbstractQueue<E>
Class Inheritance
Known Direct Subclasses
org.pcollections.AmortizedPQueue
Imports
java.util.AbstractQueue, .Collection, java.util.function.Predicate

A subclass of AbstractQueue that overrides the various mutator methods to mark them as deprecated and unconditionally throw UnsupportedOperationException.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
add(final E
the element to add
e
)

Overrides java.util.AbstractQueue.add.

Implements java.util.Queue.add, java.util.Collection.add.

Deprecated Unsupported operation.

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning 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 queue
c
)

Overrides java.util.AbstractQueue.addAll.

Implements java.util.Collection.addAll.

Deprecated Unsupported operation.

Adds all of the elements in the specified collection to this queue.

public void
clear()

Overrides java.util.AbstractQueue.clear.

Implements java.util.Collection.clear.

Deprecated Unsupported operation.

Removes all of the elements from this queue.

public boolean
offer(final E
the element to add
e
)

Implements java.util.Queue.offer.

Deprecated Unsupported operation.

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.

public E
poll()

Implements java.util.Queue.poll.

Deprecated Unsupported operation.

Retrieves and removes the head of this queue, or returns null if this queue is empty.

public E
remove()

Overrides java.util.AbstractQueue.remove.

Implements java.util.Queue.remove.

Deprecated Unsupported operation.

Retrieves and removes the head of this queue.

public boolean
remove(final Object
element to be removed from this collection, if present
o
)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Collection.remove.

Deprecated Unsupported operation.

Removes a single instance of the specified element from this collection, if it is present (optional operation).

public boolean
removeAll(final Collection<?>
collection containing elements to be removed from this collection
c
)

Overrides java.util.AbstractCollection.removeAll.

Implements java.util.Collection.removeAll.

Deprecated Unsupported operation.

Removes all of this collection's elements that are also contained in the specified collection (optional operation).

public boolean
removeIf(final Predicate<? super E>
a predicate which returns true for elements to be removed
filter
)

Overrides default java.util.Collection.removeIf.

Deprecated Unsupported operation.

Removes all of the elements of this collection that satisfy the given predicate (optional operation).

public boolean
retainAll(final Collection<?>
collection containing elements to be retained in this collection
list
)

Overrides java.util.AbstractCollection.retainAll.

Implements java.util.Collection.retainAll.

Deprecated Unsupported operation.

Retains only the elements in this collection that are contained in the specified collection (optional operation).

Inherited from java.util.AbstractQueue:
element

Constructor Detail

AbstractUnmodifiableQueueback to summary
public AbstractUnmodifiableQueue()

Method Detail

addback to summary
public boolean add(final E e)

Overrides java.util.AbstractQueue.add.

Implements java.util.Queue.add, java.util.Collection.add.

Doc from java.util.AbstractQueue.add.

Deprecated

Unsupported operation.

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available.

This implementation returns true if offer succeeds, else throws an IllegalStateException.

Parameters
e:E

the element to add

Returns:boolean

true (as specified by Collection#add)

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
addAllback to summary
public boolean addAll(final Collection<? extends E> c)

Overrides java.util.AbstractQueue.addAll.

Implements java.util.Collection.addAll.

Doc from java.util.AbstractQueue.addAll.

Deprecated

Unsupported operation.

Adds all of the elements in the specified collection to this queue. Attempts to addAll of a queue to itself result in IllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress.

This implementation iterates over the specified collection, and adds each element returned by the iterator to this queue, in turn. A runtime exception encountered while trying to add an element (including, in particular, a null element) may result in only some of the elements having been successfully added when the associated exception is thrown.

Parameters
c:Collection<? extends E>

collection containing elements to be added to this queue

Returns:boolean

true if this queue changed as a result of the call

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
clearback to summary
public void clear()

Overrides java.util.AbstractQueue.clear.

Implements java.util.Collection.clear.

Doc from java.util.AbstractQueue.clear.

Deprecated

Unsupported operation.

Removes all of the elements from this queue. The queue will be empty after this call returns.

This implementation repeatedly invokes poll until it returns null.

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
offerback to summary
public boolean offer(final E e)

Implements java.util.Queue.offer.

Doc from java.util.Queue.offer.

Deprecated

Unsupported operation.

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 add, which can fail to insert an element only by throwing an exception.

Parameters
e:E

the element to add

Returns:boolean

true if the element was added to this queue, else false

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
pollback to summary
public E poll()

Implements java.util.Queue.poll.

Doc from java.util.Queue.poll.

Deprecated

Unsupported operation.

Retrieves and removes the head of this queue, or returns null if this queue is empty.

Returns:E

the head of this queue, or null if this queue is empty

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
removeback to summary
public E remove()

Overrides java.util.AbstractQueue.remove.

Implements java.util.Queue.remove.

Doc from java.util.AbstractQueue.remove.

Deprecated

Unsupported operation.

Retrieves and removes the head of this queue. This method differs from poll only in that it throws an exception if this queue is empty.

This implementation returns the result of poll unless the queue is empty.

Returns:E

the head of this queue

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
removeback to summary
public boolean remove(final Object o)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Collection.remove.

Doc from java.util.Collection.remove.

Deprecated

Unsupported operation.

Removes a single instance of the specified element from this collection, if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).

Parameters
o:Object

element to be removed from this collection, if present

Returns:boolean

true if an element was removed as a result of this call

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
removeAllback to summary
public boolean removeAll(final Collection<?> c)

Overrides java.util.AbstractCollection.removeAll.

Implements java.util.Collection.removeAll.

Doc from java.util.Collection.removeAll.

Deprecated

Unsupported operation.

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.

Parameters
c:Collection<?>

collection containing elements to be removed from this collection

Returns:boolean

true if this collection changed as a result of the call

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
removeIfback to summary
public boolean removeIf(final Predicate<? super E> filter)

Overrides default java.util.Collection.removeIf.

Doc from java.util.Collection.removeIf.

Deprecated

Unsupported operation.

Removes all of the elements of this collection that satisfy the given predicate (optional operation). Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.

Parameters
filter:Predicate<? super E>

a predicate which returns true for elements to be removed

Returns:boolean

true if any elements were removed

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
retainAllback to summary
public boolean retainAll(final Collection<?> list)

Overrides java.util.AbstractCollection.retainAll.

Implements java.util.Collection.retainAll.

Doc from java.util.Collection.retainAll.

Deprecated

Unsupported operation.

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.

Parameters
list:Collection<?>

collection containing elements to be retained in this collection

Returns:boolean

true if this collection changed as a result of the call

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always