Class AbstractLinkedList<E>
- Type Parameters:
E- the type of elements in this list
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>,SequencedCollection<E>
- Direct Known Subclasses:
CursorableLinkedList,NodeCachingLinkedList
Overridable methods are provided to change the storage node and to change how nodes are added to and removed. Hopefully, all you need for unusual subclasses is here.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.booleanDeprecated.booleanaddAll(int index, Collection<? extends E> coll) Deprecated.booleanaddAll(Collection<? extends E> coll) Deprecated.booleanDeprecated.Adds an element at the beginning.booleanDeprecated.Adds an element at the end.voidclear()Deprecated.booleanDeprecated.booleancontainsAll(Collection<?> coll) Deprecated.booleanDeprecated.get(int index) Deprecated.getFirst()Deprecated.Gets the first element.getLast()Deprecated.Gets the last element.inthashCode()Deprecated.intDeprecated.booleanisEmpty()Deprecated.iterator()Deprecated.intlastIndexOf(Object value) Deprecated.Deprecated.listIterator(int fromIndex) Deprecated.remove(int index) Deprecated.booleanDeprecated.booleanremoveAll(Collection<?> coll) Deprecated.Deprecated.Removes the first element.Deprecated.Removes the last element.booleanretainAll(Collection<?> coll) Deprecated.Deprecated.intsize()Deprecated.subList(int fromIndexInclusive, int toIndexExclusive) Deprecated.Gets a sublist of the main list.Object[]toArray()Deprecated.<T> T[]toArray(T[] array) Deprecated.toString()Deprecated.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, reversed, sort, spliterator
-
Method Details
-
add
Deprecated. -
add
Deprecated. -
addAll
Deprecated. -
addAll
Deprecated. -
addFirst
Deprecated.Adds an element at the beginning. -
addLast
Deprecated.Adds an element at the end. -
clear
public void clear()Deprecated. -
contains
Deprecated. -
containsAll
Deprecated.- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>
-
equals
Deprecated. -
get
Deprecated. -
getFirst
Deprecated.Gets the first element. -
getLast
Deprecated.Gets the last element. -
hashCode
public int hashCode()Deprecated. -
indexOf
Deprecated. -
isEmpty
public boolean isEmpty()Deprecated. -
iterator
Deprecated. -
lastIndexOf
Deprecated.- Specified by:
lastIndexOfin interfaceList<E>
-
listIterator
Deprecated.- Specified by:
listIteratorin interfaceList<E>
-
listIterator
Deprecated.- Specified by:
listIteratorin interfaceList<E>
-
remove
Deprecated. -
remove
Deprecated. -
removeAll
Deprecated.This implementation iterates over the elements of this list, checking each element in turn to see if it's contained in
coll. If it's contained, it's removed from this list. As a consequence, it is advised to use a collection type forcollthat provides a fast (for example O(1)) implementation ofCollection.contains(Object). -
removeFirst
Deprecated.Removes the first element.- Specified by:
removeFirstin interfaceList<E>- Specified by:
removeFirstin interfaceSequencedCollection<E>- Returns:
- The value removed.
-
removeLast
Deprecated.Removes the last element.- Specified by:
removeLastin interfaceList<E>- Specified by:
removeLastin interfaceSequencedCollection<E>- Returns:
- The value removed.
-
retainAll
Deprecated.This implementation iterates over the elements of this list, checking each element in turn to see if it's contained in
coll. If it's not contained, it's removed from this list. As a consequence, it is advised to use a collection type forcollthat provides a fast (for example O(1)) implementation ofCollection.contains(Object). -
set
Deprecated. -
size
public int size()Deprecated. -
subList
Deprecated.Gets a sublist of the main list. -
toArray
Deprecated. -
toArray
public <T> T[] toArray(T[] array) Deprecated. -
toString
Deprecated.
-
AbstractLinkedListJava21instead