Top Description Fields Constructors Methods
org.pcollections

public abstract Class AbstractUnmodifiableList<E>

extends AbstractList<E>
Class Inheritance
Known Direct Subclasses
org.pcollections.TreePVector
Imports
java.util.AbstractList, .Collection, .Comparator, java.util.function.Predicate, .UnaryOperator

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

Field Summary

Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
add(final E
element to be appended to this list
e
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add, java.util.Collection.add.

Deprecated Unsupported operation.

Appends the specified element to the end of this list (optional operation).

public void
add(final int
index at which the specified element is to be inserted
index
,
final E
element to be inserted
element
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Deprecated Unsupported operation.

Inserts the specified element at the specified position in this list (optional operation).

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

Overrides java.util.AbstractCollection.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Deprecated Unsupported operation.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).

public boolean
addAll(final int
index at which to insert the first element from the specified collection
index
,
final Collection<? extends E>
collection containing elements to be added to this list
c
)

Overrides java.util.AbstractList.addAll.

Implements java.util.List.addAll.

Deprecated Unsupported operation.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

public void
clear()

Overrides java.util.AbstractList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Deprecated Unsupported operation.

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

public E
remove(final int
the index of the element to be removed
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Deprecated Unsupported operation.

Removes the element at the specified position in this list (optional operation).

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

Overrides java.util.AbstractCollection.remove.

Implements java.util.List.remove, java.util.Collection.remove.

Deprecated Unsupported operation.

Removes the first occurrence of the specified element from this list, if it is present (optional operation).

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

Overrides java.util.AbstractCollection.removeAll.

Implements java.util.List.removeAll, java.util.Collection.removeAll.

Deprecated Unsupported operation.

Removes from this list all of its elements that are 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 void
replaceAll(UnaryOperator<E>
the operator to apply to each element
operator
)

Overrides default java.util.List.replaceAll.

Deprecated Unsupported operation.

Replaces each element of this list with the result of applying the operator to that element (optional operation).

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

Overrides java.util.AbstractCollection.retainAll.

Implements java.util.List.retainAll, java.util.Collection.retainAll.

Deprecated Unsupported operation.

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

public E
set(final int
index of the element to replace
index
,
final E
element to be stored at the specified position
element
)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Deprecated Unsupported operation.

Replaces the element at the specified position in this list with the specified element (optional operation).

public void
sort(Comparator<? super E>
the Comparator used to compare list elements. A null value indicates that the elements' natural ordering should be used
c
)

Overrides default java.util.List.sort.

Deprecated Unsupported operation.

Sorts this list according to the order induced by the specified Comparator (optional operation).

Inherited from java.util.AbstractList:
equalsgethashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Constructor Detail

AbstractUnmodifiableListback to summary
public AbstractUnmodifiableList()

Method Detail

addback to summary
public boolean add(final E e)

Overrides java.util.AbstractList.add.

Implements java.util.List.add, java.util.Collection.add.

Doc from java.util.AbstractList.add.

Deprecated

Unsupported operation.

Appends the specified element to the end of this list (optional operation).

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

Parameters
e:E

element to be appended to this list

Returns:boolean

true (as specified by Collection#add)

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
addback to summary
public void add(final int index, final E element)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Doc from java.util.AbstractList.add.

Deprecated

Unsupported operation.

Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:int

Doc from java.util.List.add.

index at which the specified element is to be inserted

element:E

Doc from java.util.List.add.

element to be inserted

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.List.addAll, java.util.Collection.addAll.

Doc from java.util.List.addAll.

Deprecated

Unsupported operation.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

Parameters
c:Collection<? extends E>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

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

Overrides java.util.AbstractList.addAll.

Implements java.util.List.addAll.

Doc from java.util.AbstractList.addAll.

Deprecated

Unsupported operation.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

Parameters
index:int

Doc from java.util.List.addAll.

index at which to insert the first element from the specified collection

c:Collection<? extends E>

Doc from java.util.List.addAll.

collection containing elements to be added to this list

Returns:boolean

Doc from java.util.List.addAll.

true if this list changed as a result of the call

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

Overrides java.util.AbstractList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Doc from java.util.AbstractList.clear.

Deprecated

Unsupported operation.

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

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

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Doc from java.util.AbstractList.remove.

Deprecated

Unsupported operation.

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Parameters
index:int

Doc from java.util.List.remove.

the index of the element to be removed

Returns:E

Doc from java.util.List.remove.

the element previously at the specified position

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

Overrides java.util.AbstractCollection.remove.

Implements java.util.List.remove, java.util.Collection.remove.

Doc from java.util.List.remove.

Deprecated

Unsupported operation.

Removes the first occurrence of the specified element from this list, if it is present (optional operation). If this list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that Objects.equals(o, get(i)) (if such an element exists). Returns true if this list contained the specified element (or equivalently, if this list changed as a result of the call).

Parameters
o:Object

element to be removed from this list, if present

Returns:boolean

true if this list contained the specified element

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

Overrides java.util.AbstractCollection.removeAll.

Implements java.util.List.removeAll, java.util.Collection.removeAll.

Doc from java.util.List.removeAll.

Deprecated

Unsupported operation.

Removes from this list all of its elements that are contained in the specified collection (optional operation).

Parameters
c:Collection<?>

collection containing elements to be removed from this list

Returns:boolean

true if this list 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
replaceAllback to summary
public void replaceAll(UnaryOperator<E> operator)

Overrides default java.util.List.replaceAll.

Doc from java.util.List.replaceAll.

Deprecated

Unsupported operation.

Replaces each element of this list with the result of applying the operator to that element (optional operation). Errors or runtime exceptions thrown by the operator are relayed to the caller.

Parameters
operator:UnaryOperator<E>

the operator to apply to each element

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

Overrides java.util.AbstractCollection.retainAll.

Implements java.util.List.retainAll, java.util.Collection.retainAll.

Doc from java.util.List.retainAll.

Deprecated

Unsupported operation.

Retains only the elements in this list that are contained in the specified collection (optional operation). In other words, removes from this list all of its elements that are not contained in the specified collection.

Parameters
list:Collection<?>

collection containing elements to be retained in this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
setback to summary
public E set(final int index, final E element)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Doc from java.util.AbstractList.set.

Deprecated

Unsupported operation.

Replaces the element at the specified position in this list with the specified element (optional operation).

Parameters
index:int

Doc from java.util.List.set.

index of the element to replace

element:E

Doc from java.util.List.set.

element to be stored at the specified position

Returns:E

Doc from java.util.List.set.

the element previously at the specified position

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always
sortback to summary
public void sort(Comparator<? super E> c)

Overrides default java.util.List.sort.

Doc from java.util.List.sort.

Deprecated

Unsupported operation.

Sorts this list according to the order induced by the specified Comparator (optional operation). The sort is stable: this method must not reorder equal elements.

All elements in this list must be mutually comparable using the specified comparator (that is, c.compare(e1, e2) must not throw a ClassCastException for any elements e1 and e2 in the list).

If the specified comparator is null then all elements in this list must implement the Comparable interface and the elements' natural ordering should be used.

This list must be modifiable, but need not be resizable.

Parameters
c:Comparator<? super E>

the Comparator used to compare list elements. A null value indicates that the elements' natural ordering should be used

Annotations
@Deprecated
@Override
Exceptions
UnsupportedOperationException:
always