--- Jari Worsley <[EMAIL PROTECTED]> wrote:
> 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?

Where I see this being of use is when I have two parallel Lists that
need to be accessed in unison.  I can use the "SequencedHashMap" as a
container for them.  A good usage example is the Input:select taglib
over in Jakarta Taglibs.  A Map is used for the value (Map key) and
display (Map value) of the &lt;option&gt; tags within the Select tag.
This effect could just as well be achieved with two Lists, or even a
two-dimensional array (I once wrote an HTML object library using the
latter technique, see
http://www.brainopolis.com/jsp/javadocs/com/brainopolis/html/SelectList.html).

> 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
> )?

Not to be argumentative, but I don't see how I would implement equals()
such that it knows when an instance was placed into a Map.

> 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"... :)

I agree, "sequenced" doesn't really give enough information.  Likewise,
the forthcoming 1.4 class LinkedHashMap doesn't tell me anything
(perhaps I don't understand what "Linked" means here).  I like
(whoever's) suggestion of "InputOrderedHashMap" even if it is a bit
wordy.


=====
Lance Lavandowska
Http://www.brainopolis.com/

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

Reply via email to