java.lang.Object | +--org.apache.commons.collections.list.AbstractLinkedListAll Implemented Interfaces:
transient AbstractLinkedList.Node | A Node which indicates the start and end of the list and does not hold a value. |
transient int | Modification count for iterators |
transient int | The size of the list |
Constructor that does nothing intended for deserialization. |
AbstractLinkedList(Collection coll) Constructs a list copying data from the specified collection. |
boolean | add(Object value) |
void | add(int index, Object value) |
boolean | addAll(Collection coll) |
boolean | addAll(int index, Collection coll) |
boolean | addFirst(Object o) |
boolean | addLast(Object o) |
void | addNode(AbstractLinkedList.Node nodeToInsert, AbstractLinkedList.Node insertBeforeNode) Inserts a new node into the list. |
void | addNodeAfter(AbstractLinkedList.Node node, Object value) Creates a new node with the specified object as its value and inserts it after node. |
void | addNodeBefore(AbstractLinkedList.Node node, Object value) Creates a new node with the specified object as its value and inserts it before node. |
void | clear() |
boolean | contains(Object value) |
boolean | containsAll(Collection coll) |
Creates a new node with previous, next and element all set to null. | |
createNode(Object value) Creates a new node with the specified properties. | |
Iterator | createSubListIterator(AbstractLinkedList.LinkedSubList subList) Creates an iterator for the sublist. |
ListIterator | createSubListListIterator(AbstractLinkedList.LinkedSubList subList, int fromIndex) Creates a list iterator for the sublist. |
void | doReadObject(ObjectInputStream inputStream) Deserializes the data held in this object to the stream specified. |
void | doWriteObject(ObjectOutputStream outputStream) Serializes the data held in this object to the stream specified. |
boolean | equals(Object obj) |
Object | get(int index) |
Object | getFirst() |
Object | getLast() |
getNode(int index, boolean endMarkerAllowed) Gets the node at a particular index. | |
int | hashCode() |
int | indexOf(Object value) |
void | init() The equivalent of a default constructor, broken out so it can be called by any constructor and by readObject. |
boolean | isEmpty() |
boolean | isEqualValue(Object value1, Object value2) Compares two values for equals. |
Iterator | iterator() |
int | lastIndexOf(Object value) |
ListIterator | |
ListIterator | listIterator(int fromIndex) |
Object | remove(int index) |
boolean | remove(Object value) |
boolean | removeAll(Collection coll) |
void | Removes all nodes by resetting the circular list marker. |
Object | |
Object | |
void | removeNode(AbstractLinkedList.Node node) Removes the specified node from the list. |
boolean | retainAll(Collection coll) |
Object | set(int index, Object value) |
int | size() |
List | subList(int fromIndexInclusive, int toIndexExclusive) Gets a sublist of the main list. |
Object[] | toArray() |
Object[] | toArray(Object[] array) |
String | toString() |
void | updateNode(AbstractLinkedList.Node node, Object value) Updates the node with a new value. |
protected transient AbstractLinkedList.Node header
next
is the first item in the
list. The value of of previous
is the last item in the list.
protected transient int modCount
protected transient int size
protected AbstractLinkedList()
protected AbstractLinkedList(Collection coll)
public void add(int index, Object value)
public boolean add(Object value)
public boolean addAll(Collection coll)
public boolean addAll(int index, Collection coll)
public boolean addFirst(Object o)
public boolean addLast(Object o)
protected void addNode(AbstractLinkedList.Node nodeToInsert, AbstractLinkedList.Node insertBeforeNode)
- if either node is nullprotected void addNodeAfter(AbstractLinkedList.Node node, Object value)
value
and inserts it after node
.
This implementation uses createNode(Object) and
addNode(AbstractLinkedList.Node,AbstractLinkedList.Node).
- if node is nullprotected void addNodeBefore(AbstractLinkedList.Node node, Object value)
value
and inserts it before node
.
This implementation uses createNode(Object) and
addNode(AbstractLinkedList.Node,AbstractLinkedList.Node).
- if node is nullpublic void clear()
public boolean contains(Object value)
public boolean containsAll(Collection coll)
protected AbstractLinkedList.Node createHeaderNode()
protected AbstractLinkedList.Node createNode(Object value)
protected Iterator createSubListIterator(AbstractLinkedList.LinkedSubList subList)
protected ListIterator createSubListListIterator(AbstractLinkedList.LinkedSubList subList, int fromIndex)
protected void doReadObject(ObjectInputStream inputStream)
readObject
.
protected void doWriteObject(ObjectOutputStream outputStream)
writeObject
.
public boolean equals(Object obj)
public Object get(int index)
public Object getFirst()
public Object getLast()
protected AbstractLinkedList.Node getNode(int index, boolean endMarkerAllowed)
- if the index is less than 0; equal to
the size of the list and endMakerAllowed is false; or greater than the
size of the listpublic int hashCode()
public int indexOf(Object value)
protected void init()
readObject
.
Subclasses which override this method should make sure they call super,
so the list is initialised properly.
public boolean isEmpty()
protected boolean isEqualValue(Object value1, Object value2)
public Iterator iterator()
public int lastIndexOf(Object value)
public ListIterator listIterator()
public ListIterator listIterator(int fromIndex)
public Object remove(int index)
public boolean remove(Object value)
public boolean removeAll(Collection coll)
protected void removeAllNodes()
public Object removeFirst()
public Object removeLast()
protected void removeNode(AbstractLinkedList.Node node)
- if node is nullpublic boolean retainAll(Collection coll)
public Object set(int index, Object value)
public int size()
public List subList(int fromIndexInclusive, int toIndexExclusive)
public Object[] toArray()
public Object[] toArray(Object[] array)
public String toString()
protected void updateNode(AbstractLinkedList.Node node, Object value)