Lavandowska wrote:

> 
> Notice the difference: "the order in which elements are added" versus
> "according to their natural order".  This means that if I enter the
> Strings "a", "c", "b" (in that order), they will return:
> SequencedHashtable: a,c,b
> TreeMap: a,b,c
>

so you're using the hashtable as a convenient way of indexing into a
list? i.e. like a Vector/List/Whatever but with faster retrieval?

Couldn't you achieve the same effect by ensuring the objects you put
into a Vector implement equals and hashcode in a satisfactory manner,
then just rely on methods like indexOf(Object ) and contains(Object )?

Seems a bit weird - sequencedhashtable as a name implies to me that it
can be in any sequence, not just the order the elements were put in.
Something like "KeyedList" seems slightly nearer to what it does.

(note , I said "a bit weird", not "a lot weird"... :)



Jari

--
Jari Worsley
Senior Programmer
Hyperlink Interactive Ltd

Reply via email to