Class AbstractLinkedList<E>
- java.lang.Object
-
- org.apache.commons.collections4.list.AbstractLinkedList<E>
-
- Type Parameters:
E- the type of elements in this list
- All Implemented Interfaces:
java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>
- Direct Known Subclasses:
CursorableLinkedList,NodeCachingLinkedList
@Deprecated public abstract class AbstractLinkedList<E> extends java.lang.Object implements java.util.List<E>Deprecated.useAbstractLinkedListJava21insteadAn abstract implementation of a linked list which provides numerous points for subclasses to override.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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(int index, E value)Deprecated.booleanadd(E value)Deprecated.booleanaddAll(int index, java.util.Collection<? extends E> coll)Deprecated.booleanaddAll(java.util.Collection<? extends E> coll)Deprecated.booleanaddFirst(E e)Deprecated.Adds an element at the beginning.booleanaddLast(E e)Deprecated.Adds an element at the end.voidclear()Deprecated.booleancontains(java.lang.Object value)Deprecated.booleancontainsAll(java.util.Collection<?> coll)Deprecated.booleanequals(java.lang.Object obj)Deprecated.Eget(int index)Deprecated.EgetFirst()Deprecated.Gets the first element.EgetLast()Deprecated.Gets the last element.inthashCode()Deprecated.intindexOf(java.lang.Object value)Deprecated.booleanisEmpty()Deprecated.java.util.Iterator<E>iterator()Deprecated.intlastIndexOf(java.lang.Object value)Deprecated.java.util.ListIterator<E>listIterator()Deprecated.java.util.ListIterator<E>listIterator(int fromIndex)Deprecated.Eremove(int index)Deprecated.booleanremove(java.lang.Object value)Deprecated.booleanremoveAll(java.util.Collection<?> coll)Deprecated.EremoveFirst()Deprecated.Removes the first element.EremoveLast()Deprecated.Removes the last element.booleanretainAll(java.util.Collection<?> coll)Deprecated.Eset(int index, E value)Deprecated.intsize()Deprecated.java.util.List<E>subList(int fromIndexInclusive, int toIndexExclusive)Deprecated.Gets a sublist of the main list.java.lang.Object[]toArray()Deprecated.<T> T[]toArray(T[] array)Deprecated.java.lang.StringtoString()Deprecated.
-
-
-
Method Detail
-
add
public boolean add(E value)
Deprecated.
-
add
public void add(int index, E value)Deprecated.- Specified by:
addin interfacejava.util.List<E>
-
addAll
public boolean addAll(java.util.Collection<? extends E> coll)
Deprecated.
-
addAll
public boolean addAll(int index, java.util.Collection<? extends E> coll)Deprecated.- Specified by:
addAllin interfacejava.util.List<E>
-
addFirst
public boolean addFirst(E e)
Deprecated.Adds an element at the beginning.- Parameters:
e- the element to beginning.- Returns:
- true.
-
addLast
public boolean addLast(E e)
Deprecated.Adds an element at the end.- Parameters:
e- the element to add.- Returns:
- true.
-
clear
public void clear()
Deprecated.
-
contains
public boolean contains(java.lang.Object value)
Deprecated.
-
containsAll
public boolean containsAll(java.util.Collection<?> coll)
Deprecated.
-
equals
public boolean equals(java.lang.Object obj)
Deprecated.
-
getFirst
public E getFirst()
Deprecated.Gets the first element.- Returns:
- the first element.
-
getLast
public E getLast()
Deprecated.Gets the last element.- Returns:
- the last element.
-
hashCode
public int hashCode()
Deprecated.
-
indexOf
public int indexOf(java.lang.Object value)
Deprecated.- Specified by:
indexOfin interfacejava.util.List<E>
-
isEmpty
public boolean isEmpty()
Deprecated.
-
iterator
public java.util.Iterator<E> iterator()
Deprecated.
-
lastIndexOf
public int lastIndexOf(java.lang.Object value)
Deprecated.- Specified by:
lastIndexOfin interfacejava.util.List<E>
-
listIterator
public java.util.ListIterator<E> listIterator()
Deprecated.- Specified by:
listIteratorin interfacejava.util.List<E>
-
listIterator
public java.util.ListIterator<E> listIterator(int fromIndex)
Deprecated.- Specified by:
listIteratorin interfacejava.util.List<E>
-
remove
public boolean remove(java.lang.Object value)
Deprecated.
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
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
public E removeFirst()
Deprecated.Removes the first element.- Returns:
- The value removed.
-
removeLast
public E removeLast()
Deprecated.Removes the last element.- Returns:
- The value removed.
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
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).
-
size
public int size()
Deprecated.
-
subList
public java.util.List<E> subList(int fromIndexInclusive, int toIndexExclusive)
Deprecated.Gets a sublist of the main list.- Specified by:
subListin interfacejava.util.List<E>- Parameters:
fromIndexInclusive- the index to start fromtoIndexExclusive- the index to end at- Returns:
- the new sublist
-
toArray
public java.lang.Object[] toArray()
Deprecated.
-
toArray
public <T> T[] toArray(T[] array)
Deprecated.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
-