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