| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| pack-priv class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final List | |
| pack-priv final boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(E e)
Implements java. Appends the specified element to the end of this list (optional operation). |
| public void | add(int index, E element)
Implements java. Inserts the specified element at the specified position in this list (optional operation). |
| public boolean | addAll(Collection<? extends E> c)
Implements java. 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(int index, Collection<? extends E> c)
Implements java. Inserts all of the elements in the specified collection into this list at the specified position (optional operation). |
| pack-priv static void | |
| pack-priv void | |
| public void | clear()
Implements java. Removes all of the elements from this list (optional operation). |
| public boolean | contains(Object o)
Implements java. Returns |
| public boolean | containsAll(Collection<?> c)
Implements java. Returns |
| public boolean | equals(Object o)
Overrides java. Implements java. Compares the specified object with this list for equality. |
| public void | forEach(Consumer<? super E> action)
Overrides default java. Performs the given action for each element of the |
| public E | get(int i)
Implements java. Returns the element at the specified position in this list. |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this list. |
| public int | indexOf(Object o)
Implements java. Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. |
| public boolean | |
| public Iterator | iterator()
Implements java. Returns an iterator over the elements in this list in proper sequence. |
| public int | lastIndexOf(Object o)
Implements java. Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. |
| public ListIterator | listIterator()
Implements java. Returns a list iterator over the elements in this list (in proper sequence). |
| public ListIterator | listIterator(int index)
Implements java. Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. |
| public static <T> List | of(List<T> list, boolean modifiable)
Hides java. Returns an unmodifiable list containing two elements. |
| public Stream | parallelStream()
Overrides default java. Returns a possibly parallel |
| public boolean | remove(Object o)
Implements java. Removes the first occurrence of the specified element from this list, if it is present (optional operation). |
| public E | remove(int index)
Implements java. Removes the element at the specified position in this list (optional operation). |
| public boolean | removeAll(Collection<?> c)
Implements java. Removes from this list all of its elements that are contained in the specified collection (optional operation). |
| public boolean | removeIf(Predicate<? super E> filter)
Overrides default java. Removes all of the elements of this collection that satisfy the given predicate (optional operation). |
| public void | replaceAll(UnaryOperator<E> operator)
Overrides default java. Replaces each element of this list with the result of applying the operator to that element (optional operation). |
| public boolean | retainAll(Collection<?> c)
Implements java. Retains only the elements in this list that are contained in the specified collection (optional operation). |
| public List | reversed()
Overrides default java. Returns a reverse-ordered view of this collection. |
| public E | set(int index, E element)
Implements java. Replaces the element at the specified position in this list with the specified element (optional operation). |
| public int | |
| public void | sort(Comparator<? super E> c)
Overrides default java. Sorts this list according to the order induced by the specified
|
| public Spliterator | spliterator()
Overrides default java. Creates a |
| public Stream | stream()
Overrides default java. Returns a sequential |
| public List | subList(int fromIndex, int toIndex)
Implements java. Returns a view of the portion of this list between the specified
|
| public Object[] | toArray()
Implements java. Returns an array containing all of the elements in this list in proper sequence (from first to last element). |
| public <T> T[] | toArray(T[] a)
Implements java. Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. |
| public <T> T[] | toArray(IntFunction<T[]> generator)
Overrides default java. Returns an array containing all of the elements in this collection,
using the provided |
| public String |
| base | back to summary |
|---|---|
| pack-priv final List<E> base
| |
| modifiable | back to summary |
|---|---|
| pack-priv final boolean modifiable | |
| ReverseOrderListView | back to summary |
|---|---|
| private ReverseOrderListView(List<E> list, boolean modifiable) | |
| add | back to summary |
|---|---|
| public boolean add(E e) Implements java. Doc from java. 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. | |
| add | back to summary |
|---|---|
| public void add(int index, E element) Implements java. Doc from java. 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). | |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends E> c) Implements java. Doc from java. 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.) | |
| addAll | back to summary |
|---|---|
| public boolean addAll(int index, Collection<? extends E> c) Implements java. Doc from java. 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.) | |
| checkClosedRange | back to summary |
|---|---|
| pack-priv static void checkClosedRange(int index, int size) | |
| checkModifiable | back to summary |
|---|---|
| pack-priv void checkModifiable() Throws if this list is unmodifiable. This should be called from every mutator method. For bulk ops (addAll, removeAll, etc.) this throws unconditionally. In contrast, if the base list inherits a bulk op implementation from AbstractList, it might not throw if no actual mutation would be attempted (e.g., addAll on an empty collection). Arguably calling this is unnecessary for individual ops, for which the base list should always throw, but it's easier to verify the right behavior if every mutator of this class always checks. | |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the elements from this list (optional operation). The list will be empty after this call returns. | |
| contains | back to summary |
|---|---|
| public boolean contains(Object o) Implements java. Doc from java. Returns | |
| containsAll | back to summary |
|---|---|
| public boolean containsAll(Collection<?> c) Implements java. Doc from java. Returns | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Doc from java. Compares the specified object with this list for equality. Returns
| |
| forEach | back to summary |
|---|---|
| public void forEach(Consumer<? super E> action) Overrides default java. Doc from java. Performs the given action for each element of the The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified a concurrent modification policy. | |
| get | back to summary |
|---|---|
| public E get(int i) Implements java. Doc from java. Returns the element at the specified position in this list. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
This ensures that list1.equals(list2) implies that
list1.hashCode()==list2.hashCode() for any two lists,
list1 and list2, as required by the general
contract of Object#hashCode.
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(Object o) Implements java. Doc from java. Returns the index of the first occurrence of the specified element
in this list, or -1 if this list does not contain the element.
More formally, returns the lowest index | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns | |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over the elements in this list in proper sequence. | |
| lastIndexOf | back to summary |
|---|---|
| public int lastIndexOf(Object o) Implements java. Doc from java. Returns the index of the last occurrence of the specified element
in this list, or -1 if this list does not contain the element.
More formally, returns the highest index | |
| listIterator | back to summary |
|---|---|
| public ListIterator Implements java. Doc from java. Returns a list iterator over the elements in this list (in proper sequence). | |
| listIterator | back to summary |
|---|---|
| public ListIterator Implements java. Doc from java. Returns a list iterator over the elements in this list (in proper
sequence), starting at the specified position in the list.
The specified index indicates the first element that would be
returned by an initial call to | |
| of | back to summary |
|---|---|
| public static <T> List Hides java. Doc from java. Returns an unmodifiable list containing two elements. See Unmodifiable Lists for details. | |
| parallelStream | back to summary |
|---|---|
| public Stream Overrides default java. Doc from java. Returns a possibly parallel This method should be overridden when the | |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Implements java. Doc from java. 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 | |
| remove | back to summary |
|---|---|
| public E remove(int index) Implements java. Doc from java. 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. | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> c) Implements java. Doc from java. Removes from this list all of its elements that are contained in the specified collection (optional operation). | |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(Predicate<? super E> filter) Overrides default java. Doc from java. 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. | |
| replaceAll | back to summary |
|---|---|
| public void replaceAll(UnaryOperator<E> operator) Overrides default java. Doc from java. 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. | |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> c) Implements java. Doc from java. 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. | |
| reversed | back to summary |
|---|---|
| public List Overrides default java. Doc from java. Returns a reverse-ordered view of this collection. The encounter order of elements in the returned view is the inverse of the encounter order of elements in this collection. The reverse ordering affects all order-sensitive operations, including those on the view collections of the returned view. If the collection implementation permits modifications to this view, the modifications "write through" to the underlying collection. Changes to the underlying collection might or might not be visible in this reversed view, depending upon the implementation. | |
| set | back to summary |
|---|---|
| public E set(int index, E element) Implements java. Doc from java. Replaces the element at the specified position in this list with the specified element (optional operation). | |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than | |
| sort | back to summary |
|---|---|
| public void sort(Comparator<? super E> c) Overrides default java. Doc from java. Sorts this list according to the order induced by the specified
All elements in this list must be mutually comparable using the
specified comparator (that is, If the specified comparator is This list must be modifiable, but need not be resizable. | |
| spliterator | back to summary |
|---|---|
| public Spliterator Overrides default java. Doc from java. Creates a The | |
| stream | back to summary |
|---|---|
| public Stream Overrides default java. Doc from java. Returns a sequential This method should be overridden when the | |
| subList | back to summary |
|---|---|
| public List Implements java. Doc from java. Returns a view of the portion of this list between the specified
This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
Similar idioms may be constructed for indexOf and
lastIndexOf, and all of the algorithms in the
Collections class can be applied to a subList.The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.) | |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Implements java. Doc from java. Returns an array containing all of the elements in this list in proper sequence (from first to last element). The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). The caller is thus free to modify the returned array. This method acts as bridge between array-based and collection-based APIs. | |
| toArray | back to summary |
|---|---|
| public <T> T[] toArray(T[] a) Implements java. Doc from java. Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list. If the list fits in the specified array with room to spare (i.e.,
the array has more elements than the list), the element in the array
immediately following the end of the list is set to Like the Suppose
Note that toArray(new Object[0]) is identical in function to
toArray().
| |
| toArray | back to summary |
|---|---|
| public <T> T[] toArray(IntFunction<T[]> generator) Overrides default java. Doc from java. Returns an array containing all of the elements in this collection,
using the provided If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ListIterator |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public E | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| it | back to summary |
|---|---|
| pack-priv final ListIterator<E> it | |
| DescendingIterator | back to summary |
|---|---|
| pack-priv DescendingIterator() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns | |
| next | back to summary |
|---|---|
| public E next() Implements java. Doc from java. Returns the next element in the iteration. | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ListIterator |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(E e)
Implements java. Inserts the specified element into the list (optional operation). |
| public boolean | hasNext()
Implements java. Returns |
| public boolean | hasPrevious()
Implements java. Returns |
| public E | next()
Implements java. Returns the next element in the list and advances the cursor position. |
| public int | nextIndex()
Implements java. Returns the index of the element that would be returned by a
subsequent call to |
| public E | previous()
Implements java. Returns the previous element in the list and moves the cursor position backwards. |
| public int | previousIndex()
Implements java. Returns the index of the element that would be returned by a
subsequent call to |
| public void | remove()
Implements java. Removes from the list the last element that was returned by |
| public void | set(E e)
Implements java. Replaces the last element returned by |
| it | back to summary |
|---|---|
| pack-priv final ListIterator<E> it | |
| DescendingListIterator | back to summary |
|---|---|
| pack-priv DescendingListIterator(int size, int pos) | |
| add | back to summary |
|---|---|
| public void add(E e) Implements java. Doc from java. Inserts the specified element into the list (optional operation).
The element is inserted immediately before the element that
would be returned by | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns | |
| hasPrevious | back to summary |
|---|---|
| public boolean hasPrevious() Implements java. Doc from java. Returns | |
| next | back to summary |
|---|---|
| public E next() Implements java. Doc from java. Returns the next element in the list and advances the cursor position.
This method may be called repeatedly to iterate through the list,
or intermixed with calls to | |
| nextIndex | back to summary |
|---|---|
| public int nextIndex() Implements java. Doc from java. Returns the index of the element that would be returned by a
subsequent call to | |
| previous | back to summary |
|---|---|
| public E previous() Implements java. Doc from java. Returns the previous element in the list and moves the cursor
position backwards. This method may be called repeatedly to
iterate through the list backwards, or intermixed with calls to
| |
| previousIndex | back to summary |
|---|---|
| public int previousIndex() Implements java. Doc from java. Returns the index of the element that would be returned by a
subsequent call to | |
| remove | back to summary |
|---|---|
| public void remove() Implements java. Doc from java. Removes from the list the last element that was returned by | |
| set | back to summary |
|---|---|
| public void set(E e) Implements java. Doc from java. Replaces the last element returned by | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Rand | back to summary |
|---|---|
| pack-priv Rand(List<E> list, boolean modifiable) | |