E - the class of the elements of this list.public static final class CollectionsExt.ImmutableList<E> extends CollectionsExt.AbstractImmutableCollection<List<E>,E> implements List<E>
| Modifier and Type | Field and Description |
|---|---|
private List<E> |
list
The enclosed list containing the elements of this list.
|
| Constructor and Description |
|---|
ImmutableList(List<E> list) |
ImmutableList(Set<CollectionsExt.Modification> mods,
List<E> list) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
E obj) |
boolean |
addAll(int index,
Collection<? extends E> coll) |
boolean |
equals(Object obj) |
E |
get(int index) |
int |
hashCode() |
int |
indexOf(Object obj) |
int |
lastIndexOf(Object obj) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
E |
remove(int index) |
void |
replaceAll(UnaryOperator<E> operator) |
E |
set(int index,
E element) |
void |
sort(Comparator<? super E> cmp) |
List<E> |
subList(int fromIndex,
int toIndex) |
List<E> |
unrestricted()
Returns the underlying set without the restrictions
imposed by this
CollectionsExt.ImmutableCollection. |
add, addAll, allowedModifications, allowModification, allowModifications, clear, iterator, remove, removeAll, removeIf, retainAll, size, toStringcontains, containsAll, isEmpty, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streamImmutableList(Set<CollectionsExt.Modification> mods, List<E> list)
public List<E> unrestricted()
CollectionsExt.AbstractImmutableCollectionCollectionsExt.ImmutableCollection.
Note that the result
may still throw UnsupportedOperationExceptions
depending on the implementation.unrestricted in class CollectionsExt.AbstractImmutableCollection<List<E>,E>public void add(int index,
E obj)
add in interface List<E>UnsupportedOperationException - if either unrestricted() does not allow this operation
or AddObj
is no allowed operation
according to CollectionsExt.AbstractImmutableCollection.allowedModifications().public boolean addAll(int index,
Collection<? extends E> coll)
addAll in interface List<E>UnsupportedOperationException - if either unrestricted() does not allow this operation
or AddObj
is no allowed operation
according to CollectionsExt.AbstractImmutableCollection.allowedModifications().
In the latter case it does not matter,
whether effectively it is tried to add objects
which is the case only coll is not empty.public int hashCode()
public boolean equals(Object obj)
public int lastIndexOf(Object obj)
lastIndexOf in interface List<E>public ListIterator<E> listIterator()
listIterator in interface List<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>public E remove(int index)
remove in interface List<E>UnsupportedOperationException - if either unrestricted() does not allow this operation
or RemoveObj
is no allowed operation
according to CollectionsExt.AbstractImmutableCollection.allowedModifications().public E set(int index, E element)
set in interface List<E>UnsupportedOperationException - if either unrestricted() does not allow this operation
or SetObj
is no allowed operation
according to CollectionsExt.AbstractImmutableCollection.allowedModifications().
In the latter case it does not matter,
whether effectively it is tried to set an object
which is the case only if element
is not at place index in this.public void replaceAll(UnaryOperator<E> operator)
replaceAll in interface List<E>UnsupportedOperationException - if either unrestricted() does not allow this operation
or SetObj
is no allowed operation
according to CollectionsExt.AbstractImmutableCollection.allowedModifications().
In the latter case it does not matter,
whether effectively it is tried to replace an object
which is the case only if operator
really changes an object.public void sort(Comparator<? super E> cmp)
sort in interface List<E>UnsupportedOperationException - if either unrestricted() does not allow this operation
or SetObj
is no allowed operation
according to CollectionsExt.AbstractImmutableCollection.allowedModifications().
In the latter case it does not matter,
whether effectively it is tried to replace an object
which is the case only if this
is not completely sorted according to cmp.
This definition is in conjunction with the requirement,
of List.sort(Comparator)
that this exception is thrown iff the list iterator
does not permit the ListIterator.set(Object) method.Copyright © 2012–2018 Simuline Organization (l2r). All rights reserved.