Additional top-level classes in compilation unit: ListIteratorImpl, SubList.
| Modifier and Type | Method and Description |
|---|---|
| public default boolean | contains(Object o)
Implements java. Returns |
| public default boolean | containsAll(Collection<?> c)
Implements java. Returns |
| public default 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 default boolean | |
| public default Iterator | iterator()
Implements java. Returns an iterator over the elements in this list in proper sequence. |
| public default 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 default ListIterator | listIterator()
Implements java. Returns a list iterator over the elements in this list (in proper sequence). |
| public default 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 default List | subList(int fromIndex, int toIndex)
Implements java. Returns a view of the portion of this list between the specified
|
| public default Object[] | toArray()
Implements java. Returns an array containing all of the elements in this list in proper sequence (from first to last element). |
| public default <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. |
| contains | back to summary |
|---|---|
| public default boolean contains(Object o) Implements java. Doc from java. Returns
| |
| containsAll | back to summary |
|---|---|
| public default boolean containsAll(Collection<?> c) Implements java. Doc from java. Returns
| |
| indexOf | back to summary |
|---|---|
| public default 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 default boolean isEmpty() Implements java. Doc from java. Returns
| |
| iterator | back to summary |
|---|---|
| public default Iterator Implements java. Doc from java. Returns an iterator over the elements in this list in proper sequence.
| |
| lastIndexOf | back to summary |
|---|---|
| public default 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 default ListIterator Implements java. Doc from java. Returns a list iterator over the elements in this list (in proper sequence).
| |
| listIterator | back to summary |
|---|---|
| public default 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
| |
| subList | back to summary |
|---|---|
| public default 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 default 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 default <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().
| |