Top Description Constructors Methods
org.pcollections

public abstract Class AbstractUnmodifiableCollection<E>

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

A subclass of AbstractCollection 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
element whose presence in this collection is to be ensured
e
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Collection.add.

Deprecated Unsupported operation.

Ensures that this collection contains the specified element (optional operation).

public boolean
addAll(final Collection<? extends E>
collection containing elements to be added to this collection
c
)

Overrides java.util.AbstractCollection.addAll.

Implements java.util.Collection.addAll.

Deprecated Unsupported operation.

Adds all of the elements in the specified collection to this collection (optional operation).

public void
clear()

Overrides java.util.AbstractCollection.clear.

Implements java.util.Collection.clear.

Deprecated Unsupported operation.

Removes all of the elements from this collection (optional operation).

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.AbstractCollection:
containscontainsAllisEmptyiteratorsizetoArraytoArraytoString

Constructor Detail

AbstractUnmodifiableCollectionback to summary
public AbstractUnmodifiableCollection()

Method Detail

addback to summary
public boolean add(final E e)

Overrides java.util.AbstractCollection.add.

Implements java.util.Collection.add.

Doc from java.util.AbstractCollection.add.

Deprecated

Unsupported operation.

Ensures that this collection contains the specified element (optional operation). Returns true if this collection changed as a result of the call. (Returns false if this collection does not permit duplicates and already contains the specified element.)

Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.

If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning false). This preserves the invariant that a collection always contains the specified element after this call returns.

Parameters
e:E

Doc from java.util.Collection.add.

element whose presence in this collection is to be ensured

Returns:boolean

Doc from java.util.Collection.add.

true if this collection changed as a result of the call

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

Overrides java.util.AbstractCollection.addAll.

Implements java.util.Collection.addAll.

Doc from java.util.AbstractCollection.addAll.

Deprecated

Unsupported operation.

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.

Parameters
c:Collection<? extends E>

Doc from java.util.Collection.addAll.

collection containing elements to be added to this collection

Returns:boolean

Doc from java.util.Collection.addAll.

true if this collection changed as a result of the call

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

Overrides java.util.AbstractCollection.clear.

Implements java.util.Collection.clear.

Doc from java.util.AbstractCollection.clear.

Deprecated

Unsupported operation.

Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns.

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.AbstractCollection.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

Doc from java.util.Collection.remove.

element to be removed from this collection, if present

Returns:boolean

Doc from java.util.Collection.remove.

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.AbstractCollection.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<?>

Doc from java.util.Collection.removeAll.

collection containing elements to be removed from this collection

Returns:boolean

Doc from java.util.Collection.removeAll.

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.AbstractCollection.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<?>

Doc from java.util.Collection.retainAll.

collection containing elements to be retained in this collection

Returns:boolean

Doc from java.util.Collection.retainAll.

true if this collection changed as a result of the call

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always