net.cscott.jutil

Class Default.PairList<A,B>

public static class Default.PairList<A,B> extends AbstractList implements Serializable

Pairs, implemented as a List. The 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 java.util.Map.Entrys; the parameterization is different as well.
Constructor Summary
PairList(A left, B right)
Method Summary
Objectget(int index)
Aleft()
Return the left element of the pair (head).
Bright()
Return the right element of the pair (tail).
Objectset(int index, Object element)
intsize()

Constructor Detail

PairList

public PairList(A left, B right)

Method Detail

get

public Object get(int index)

left

public A left()
Return the left element of the pair (head).

right

public B right()
Return the right element of the pair (tail).

set

public Object set(int index, Object element)

size

public int size()
Copyright (c) 2006 C. Scott Ananian