net.cscott.jutil
public static class Default.PairList<A,B> extends AbstractList implements Serializable
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 java.util.Map.Entrys; the
parameterization is different as well.
Constructor Summary | |
---|---|
PairList(A left, B right) |
Method Summary | |
---|---|
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() |