commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher (siege) "OBrien <si...@preoccupied.net>
Subject Re: [COLLECTIONS] Some more lobbying for the OrderedSet class
Date Wed, 30 Apr 2003 03:11:39 GMT

Having the methods from the List interface added to a Set to make
ListSet actually sounds pretty useful. How are you determining the
success of a call to add(int,Object)? The List interface makes that
method void rather than boolean, which seems like a problem when there's
a possibility that by some criteria the Object may not have been
actually inserted.

How are you determining the existence of a duplicate? Is there an
internal hash-table, or is it iterative? How are you determining and
maintaining the internal order? With a linked-list, or with an array?

Combining this with the name lookup portion seems like it belongs to its
own class though.

- Chris

ps: my suggestion for LinkedHashSet was off-bounds actually. I missed
that it had been brought up previously in the thread. Sorry!


> Well the LinkedHashSet is a J2SE 1.4 class, so I cannot use it as I am
> targeting the 1.3.1 J2SE.
> 
> It is however quite similar to the Commons Collections' SequencedHashMap
> class (this one I could use), but neither class does provides the direct
> indexing methods associated with the List interface such as: add(index,
> element), addAll(index, element), indexOf(element), remove(index), etc.
> Without these, I cannot arbitrarily reorder the collection at a later time
> like I could do with a List.
> 

-- 
Christopher (siege) O'Brien <siege@preoccupied.net>
http://preoccupied.net/~siege/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message