Friday, May 06, 2005

Cool Cool Java Collections

With JDK 1.2, Sun introducted the Java Collection Framework, a cool API for data-structures in Java. At the base of the heirarchy were collection interfaces like:
List: A collection that is ordered and whose members can be accessed by index. A list can also contain duplicates and null values.
Set: A collection that is not ordered and hence there are no methods that allow to access members thru a index. Also a Set does not allow duplicates and atmost one null value.

Though I personally feel that the JDK Collection framework is quite comprehensive and should suffice most development needs, it is good to know about some other alternatives:
1) Jakarta Commons Collections - An open source initiative that contains some extra cool collections like MultiMap etc.
2) JGL (Java Generic Library) - A port of the C++ STL (Standard tag library) to the Java language. Thought I was first impressed by this package, I think this API would appleal more to those from the C++ background. Also the latest version is no longer free, I believe.

No comments:

Post a Comment