AbstractList (Java SE 26 & JDK 26)
- Type Parameters:
E- the type of elements in this list
- All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, SequencedCollection<E>
- Direct Known Subclasses:
AbstractSequentialList, ArrayList, Vector
-
Field Summary
Fields
protected intThe number of times this list has been structurally modified.
-
Constructor Summary
Constructors
-
Method Summary
voidInserts the specified element at the specified position in this list (optional operation).
booleanAppends the specified element to the end of this list (optional operation).
booleanInserts all of the elements in the specified collection into this list at the specified position (optional operation).
voidclear()Removes all of the elements from this list (optional operation).
booleanCompares the specified object with this list for equality.
abstract Eget(int index) Returns the element at the specified position in this list.
inthashCode()Returns the hash code value for this list.
intReturns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
iterator()Returns an iterator over the elements in this list in proper sequence.
intReturns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
Returns a list iterator over the elements in this list (in proper sequence).
listIterator(int index) Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
remove(int index) Removes the element at the specified position in this list (optional operation).
protected voidremoveRange(int fromIndex, int toIndex) Removes from this list all of the elements whose index is between
fromIndex, inclusive, andtoIndex, exclusive.Replaces the element at the specified position in this list with the specified element (optional operation).
subList(int fromIndex, int toIndex) Returns a view of the portion of this list between the specified
fromIndex, inclusive, andtoIndex, exclusive.Methods declared in class AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringbooleanAdds all of the elements in the specified collection to this collection (optional operation).
booleanReturns
trueif this collection contains the specified element.booleanReturns
trueif this collection contains all of the elements in the specified collection.booleanReturns
trueif this collection contains no elements.booleanRemoves a single instance of the specified element from this collection, if it is present (optional operation).
booleanRemoves all of this collection's elements that are also contained in the specified collection (optional operation).
booleanRetains only the elements in this collection that are contained in the specified collection (optional operation).
Returns an array containing all of the elements in this collection.
<T> T[]Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
Returns a string representation of this collection.
Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitCreates and returns a copy of this object.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
Methods declared in interface Collection
parallelStream, removeIf, stream, toArrayReturns a possibly parallel
Streamwith this collection as its source.default booleanRemoves all of the elements of this collection that satisfy the given predicate (optional operation).
Returns a sequential
Streamwith this collection as its source.default <T> T[]Returns an array containing all of the elements in this collection, using the provided
generatorfunction to allocate the returned array.Methods declared in interface Iterable
default voidPerforms the given action for each element of the
Iterableuntil all elements have been processed or the action throws an exception.Methods declared in interface List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, size, sort, spliterator, toArray, toArraybooleanAppends 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).
default voidAdds an element as the first element of this collection (optional operation).
default voidAdds an element as the last element of this collection (optional operation).
booleanReturns
trueif this list contains the specified element.booleanReturns
trueif this list contains all of the elements of the specified collection.default EGets the first element of this collection.
default EGets the last element of this collection.
booleanReturns
trueif this list contains no elements.booleanRemoves the first occurrence of the specified element from this list, if it is present (optional operation).
booleanRemoves from this list all of its elements that are contained in the specified collection (optional operation).
default ERemoves and returns the first element of this collection (optional operation).
default ERemoves and returns the last element of this collection (optional operation).
default voidReplaces each element of this list with the result of applying the operator to that element (optional operation).
booleanRetains only the elements in this list that are contained in the specified collection (optional operation).
Returns a reverse-ordered view of this collection.
intReturns the number of elements in this list.
default voidSorts this list according to the order induced by the specified
Comparator(optional operation).Returns an array containing all of the elements in this list in proper sequence (from first to last element).
<T> T[]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.
-
Field Details
-
modCount
-
-
Constructor Details
-
AbstractList
-
-
Method Details
-
add
-
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
-
clear
-
addAll
-
iterator
-
listIterator
-
listIterator
-
subList
-
equals
-
hashCode
-
removeRange
-