public static class Default.PairList<A,B>
extends java.util.AbstractList
implements java.io.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.| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get(int index) |
A |
left()
Return the left element of the pair (head).
|
B |
right()
Return the right element of the pair (tail).
|
java.lang.Object |
set(int index,
java.lang.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, waitpublic A left()
public B right()
public int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollectionpublic java.lang.Object get(int index)
get in interface java.util.Listget in class java.util.AbstractListpublic java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.Listset in class java.util.AbstractListCopyright (c) 2006 C. Scott Ananian