A little confused ;-) Are you proposing a class that implements Map, or
List, or Collection?

If its an int to Object Map, then [primitives] would be the place for it to
go. If its a List, then the implementation you describe would violate the
List interface. If its a Collection, then it might work, but I can't really
see the advantage over an ArrayList style implementation.

Stephen

----- Original Message -----
From: "Joel Shellman" <[EMAIL PROTECTED]>
> At least I think that describes it.
>
> Here's the application: I have a very large collection of objects that
> has an int key. Structural changes (add/remove) occur extremely seldom.
>
> Wouldn't it be useful to have a data structure such that accessing it by
> that key is simply an array lookup?
>
> myObject = myArray[key];
>
> Removal support could be handled by setting that index to null and
> holding on to a stack of unused indexes. Adding new values use up the
> unused indexes before appending to the end.
>
> I have already written a simple initial implementation of this. I'm
> wondering:
>
> 1) Do others think this is generally useful?
> 2) Is this functionality already available in the commons-collections
> and I missed it?
> 3) Would it be useful to include this in commons-collections?
>
> Thank you,
>
> Joel Shellman
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to