public abstract class AbstractChain<E> extends AbstractList<E> implements Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
length |
protected AbstractChain<E> |
previous |
protected E |
tailValue |
modCount
Modifier | Constructor and Description |
---|---|
protected |
AbstractChain(AbstractChain<E> prev,
E tv)
Construct a new chain node.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
E |
get(int i) |
E |
getTailValue() |
int |
hashCode() |
Iterator<E> |
iterator() |
Iterable<E> |
reverse() |
Iterator<E> |
reverseIterator()
Iterate over this chain's elements in reverse order.
|
int |
size() |
add, add, addAll, clear, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
protected final AbstractChain<E> previous
protected final E tailValue
protected final int length
protected AbstractChain(AbstractChain<E> prev, E tv)
prev
- The previous node, or null
for a singleton chain.tv
- The value to go at the end of the chain.public E getTailValue()
public int size()
size
in interface Collection<E>
size
in interface List<E>
size
in class AbstractCollection<E>
public E get(int i)
public Iterator<E> reverseIterator()
public int hashCode()
hashCode
in interface Collection<E>
hashCode
in interface List<E>
hashCode
in class AbstractList<E>
public boolean equals(Object o)
equals
in interface Collection<E>
equals
in interface List<E>
equals
in class AbstractList<E>
Copyright © 2014 GroupLens Research. All Rights Reserved.