public abstract class AbstractLinkedList<E> extends Object implements List<E>
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.
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E value) |
void |
add(int index,
E value) |
boolean |
addAll(Collection<? extends E> coll) |
boolean |
addAll(int index,
Collection<? extends E> coll) |
boolean |
addFirst(E o) |
boolean |
addLast(E o) |
void |
clear() |
boolean |
contains(Object value) |
boolean |
containsAll(Collection<?> coll) |
boolean |
equals(Object obj) |
E |
get(int index) |
E |
getFirst() |
E |
getLast() |
int |
hashCode() |
int |
indexOf(Object value) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
int |
lastIndexOf(Object value) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int fromIndex) |
E |
remove(int index) |
boolean |
remove(Object value) |
boolean |
removeAll(Collection<?> coll) |
E |
removeFirst() |
E |
removeLast() |
boolean |
retainAll(Collection<?> coll) |
E |
set(int index,
E value) |
int |
size() |
List<E> |
subList(int fromIndexInclusive,
int toIndexExclusive)
Gets a sublist of the main list.
|
Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
String |
toString() |
replaceAll, sort, spliteratorparallelStream, removeIf, streampublic int size()
public boolean isEmpty()
public ListIterator<E> listIterator()
listIterator in interface List<E>public ListIterator<E> listIterator(int fromIndex)
listIterator in interface List<E>public int lastIndexOf(Object value)
lastIndexOf in interface List<E>public boolean contains(Object value)
public boolean containsAll(Collection<?> coll)
containsAll in interface Collection<E>containsAll in interface List<E>public Object[] toArray()
public <T> T[] toArray(T[] array)
public List<E> subList(int fromIndexInclusive, int toIndexExclusive)
public boolean add(E value)
public boolean addAll(Collection<? extends E> coll)
public boolean addAll(int index,
Collection<? extends E> coll)
public boolean remove(Object value)
public boolean removeAll(Collection<?> coll)
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 for
coll that provides a fast (e.g. O(1)) implementation of
Collection.contains(Object).
public boolean retainAll(Collection<?> coll)
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 for
coll that provides a fast (e.g. O(1)) implementation of
Collection.contains(Object).
public void clear()
public E getFirst()
public E getLast()
public boolean addFirst(E o)
public boolean addLast(E o)
public E removeFirst()
public E removeLast()
public boolean equals(Object obj)
public int hashCode()
Copyright © 2010 - 2020 Adobe. All Rights Reserved