You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by JP Beaudry <jb...@cisco.com> on 2004/12/10 02:53:56 UTC

multi-key/multi index collection

Hi all,
 
I'm hoping you can provide me with some advice on how best to accomplish the
following. Perhaps there is already a well-known library or design pattern
I'm not familiar with.
 
I'd like to store objects in a collection of some sort where I can retrieve
them by their key AND have the ability to retrieve the subset of those
objects that share a common value for a given attribute. For example, if the
car class has id, color, make, model for attributes, I'd like to be able to
retrieve a specific instance by its id (which is unique and can be used as
key). I'd also like to (quickly as in cpu time) retrieve the subset of white
cars. I am willing to move to use a typed collection to insure attribute
uniformity. I am more concern with performance than memory usage.
 
Thanks for any idea or insight,
JP