List whose contents will never change, with many other important properties detailed at
ImmutableCollection.
See the Guava User Guide article on immutable collections.
ImmutableMap, ImmutableSet
| Modifier and Type | Class and Description |
|---|---|
| public static class | ImmutableList.Builder<E>
A builder for creating immutable list instances, especially |
| private static class | |
| pack-priv static class | |
| pack-priv class |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final void | add(int
index at which the specified element is to be inserted index, E element to be inserted element)Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the list unmodified.
|
| public final boolean | addAll(int
index at which to insert the first element from the
specified collection index, Collection<? extends E> collection containing elements to be added to this list newElements)Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the list unmodified.
|
| pack-priv static <E> ImmutableList | |
| pack-priv static <E> ImmutableList | |
| public final ImmutableList | asList()
Overrides com.
Deprecated
There is no reason to use this; it always returns
Returns this list instance.
this.
|
| public static <E> ImmutableList. | |
| public static <E> ImmutableList. | builderWithExpectedSize(int expectedSize)
Returns a new builder, expecting the specified number of elements to be added. |
| private static <E> ImmutableList | |
| public boolean | contains(Object
element whose presence in this list is to be tested object)Implements abstract com. Implements java. true if this list contains the specified element.
|
| pack-priv int | |
| public static <E> ImmutableList | |
| public static <E> ImmutableList | copyOf(Collection<? extends E>
a elements)Collection from which elements are drawn, must be non-nullHides java. |
| public static <E> ImmutableList | |
| public static <E> ImmutableList | |
| public boolean | equals(Object
the object to be compared for equality with this list obj)Overrides java. Implements java. |
| public void | forEach(Consumer<? super E>
The action to be performed for each element consumer)Overrides default java. Iterable
until all elements have been processed or the action throws an
exception.
|
| public int | hashCode()
Overrides java. Implements java. |
| public int | indexOf(Object
element to search for object)Implements java. |
| public UnmodifiableIterator | iterator()
Implements abstract com. Implements java. |
| public int | lastIndexOf(Object
element to search for object)Implements java. |
| public UnmodifiableListIterator | listIterator()
Implements java. |
| public UnmodifiableListIterator | listIterator(int
index of the first element to be returned from the
list iterator (by a call to index)next)Implements java. |
| public static <E> ImmutableList | |
| public static <E> ImmutableList | of(E
the single element element)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2, E the third element e3)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5, E the sixth element e6)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5, E the sixth element e6, E the seventh element e7)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5, E the sixth element e6, E the seventh element e7, E the eighth element e8)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5, E the sixth element e6, E the seventh element e7, E the eighth element e8, E the ninth element e9)Hides java. |
| public static <E> ImmutableList | of(E
the first element e1, E the second element e2, E the third element e3, E the fourth element e4, E the fifth element e5, E the sixth element e6, E the seventh element e7, E the eighth element e8, E the ninth element e9, E the tenth element e10)Hides java. |
| public static <E> ImmutableList | of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11)
Returns an immutable list containing the given elements, in order. |
| public static <E> ImmutableList | of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E e11, E e12, E... others)
Returns an immutable list containing the given elements, in order. |
| private void | |
| public final E | remove(int
the index of the element to be removed index)Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the list unmodified.
|
| public final void | replaceAll(UnaryOperator<E>
the operator to apply to each element operator)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the list unmodified.
|
| public ImmutableList | Returns: a view of this immutable list in reverse orderReturns a view of this immutable list in reverse order. |
| public final E | set(int
index of the element to replace index, E element to be stored at the specified position element)Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the list unmodified.
|
| public final void | sort(@Nullable Comparator<? super E>
the c)Comparator used to compare list elements.
A null value indicates that the elements'
natural ordering should be usedOverrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the list unmodified.
|
| public static <E extends Comparable | sortedCopyOf(Iterable<? extends E> elements)
Returns an immutable list containing the given elements, sorted according to their natural order. |
| public static <E> ImmutableList | sortedCopyOf(Comparator<? super E> comparator, Iterable<? extends E> elements)
Returns an immutable list containing the given elements, in sorted order relative to the specified comparator. |
| public Spliterator | spliterator()
Overrides com. Overrides default java. Spliterator over the elements in this list.
|
| public ImmutableList | subList(int
low endpoint (inclusive) of the subList fromIndex, int high endpoint (exclusive) of the subList toIndex)Implements java. fromIndex, inclusive,
and toIndex, exclusive.
|
| pack-priv ImmutableList | subListUnchecked(int fromIndex, int toIndex)
Called by the default implementation of |
| public static <E> Collector | toImmutableList()
Returns a |
| pack-priv Object |