public static class Default.PairList<A,B> extends AbstractList implements Serializable
List.
The Default.PairList implements hashCode()
and equals() "properly" so they can be used as keys
in hashtables and etc. They are implemented as mutable lists of
fixed size 2. Note that the hashCode() implementation
differs from pairs implemented as Map.Entrys; the
parameterization is different as well.modCount| Modifier and Type | Method and Description |
|---|---|
Object |
get(int index) |
A |
left()
Return the left element of the pair (head).
|
B |
right()
Return the right element of the pair (tail).
|
Object |
set(int index,
Object element) |
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic A left()
public B right()
public int size()
size in interface Collectionsize in interface Listsize in class AbstractCollectionpublic Object get(int index)
get in interface Listget in class AbstractListCopyright (c) 2006 C. Scott Ananian