Thursday, September 21

More powerful collections

If the Java Collections Framework is too limiting for you, then you should check out the open source Jakarta Commons Collections from the Apache project.

It adds several important extensions such as ordered maps, bi-directional maps, bags (i.e. multi-sets), Fifo queues, and certain other convenience features like iterators and transformation primitives.

I believe .Net has a multiset implementation in its System.Collections.Specialized namespace, but no bidi maps. Also Jakarta Collections adds a type-check primitive to ensure that only objects of a certain type get stored in a collections, though I don't think this removes the overhead of boxing and unboxing that you typically encounter in generic collections that store data as "Objects". Type-safe collections that don't do boxing and unboxing will necessarily speed up operations on large collections, but the only way to have that seems to be the C++ templates, .Net generics, or Java 5 generics. The trade0ff with generics is of course binary code bloat leading to larger executables, not to mention more intricate syntax.

Comments: Post a Comment

Subscribe to Post Comments [Atom]

<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]