public abstract class AbstractLinkedList<E>
extends java.lang.Object
implements java.util.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(java.util.Collection<? extends E> coll) |
boolean |
addAll(int index,
java.util.Collection<? extends E> coll) |
boolean |
addFirst(E o) |
boolean |
addLast(E o) |
void |
clear() |
boolean |
contains(java.lang.Object value) |
boolean |
containsAll(java.util.Collection<?> coll) |
boolean |
equals(java.lang.Object obj) |
E |
get(int index) |
E |
getFirst() |
E |
getLast() |
int |
hashCode() |
int |
indexOf(java.lang.Object value) |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object value) |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int fromIndex) |
E |
remove(int index) |
boolean |
remove(java.lang.Object value) |
boolean |
removeAll(java.util.Collection<?> coll) |
E |
removeFirst() |
E |
removeLast() |
boolean |
retainAll(java.util.Collection<?> coll) |
E |
set(int index,
E value) |
int |
size() |
java.util.List<E> |
subList(int fromIndexInclusive,
int toIndexExclusive)
Gets a sublist of the main list.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
java.lang.String |
toString() |
public int size()
public boolean isEmpty()
public java.util.Iterator<E> iterator()
public java.util.ListIterator<E> listIterator()
listIterator
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator(int fromIndex)
listIterator
in interface java.util.List<E>
public int indexOf(java.lang.Object value)
indexOf
in interface java.util.List<E>
public int lastIndexOf(java.lang.Object value)
lastIndexOf
in interface java.util.List<E>
public boolean contains(java.lang.Object value)
public boolean containsAll(java.util.Collection<?> coll)
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] array)
public java.util.List<E> subList(int fromIndexInclusive, int toIndexExclusive)
subList
in interface java.util.List<E>
fromIndexInclusive
- the index to start fromtoIndexExclusive
- the index to end atpublic boolean add(E value)
public boolean addAll(java.util.Collection<? extends E> coll)
public boolean addAll(int index, java.util.Collection<? extends E> coll)
addAll
in interface java.util.List<E>
public boolean remove(java.lang.Object value)
public boolean removeAll(java.util.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(java.util.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(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved