Apache Commons Collections - Overview



Commons Collections augments Java Collections Framework. It provides several features to make collection handling easy. It provides many new interfaces, implementations and utilities.

The main features of Commons Collections are as follows −

  • Bag − Bag interfaces simplifies the collections, which have multiple number of copies of each object.

  • BidiMap − BidiMap interfaces provide Bi-Directional maps, which can be used to lookup values using keys or keys using values.

  • MapIterator − MapIterator interface provide simple and easy iteration over maps.

  • Transforming Decorators − Transforming decorators can alter every object of a collection as and when it is added to the collection.

  • Composite Collections − Composite collections are used, where multiple collections are required to be handled uniformly.

  • Ordered Map − Ordered Maps retain the order, in which elements are added in.

  • Ordered Set − Ordered Sets retain the order, in which elements are added in.

  • Reference map − Reference map allows key/values to be garbage collected under close control.

  • Comparator implementations − Many Comparator implementations are available.

  • Iterator implementations − Many Iterator implementations are available.

  • Adapter Classes − Adapter classes are available to convert array and enumerations to collections.

  • Utilities − Utilities are available to test or create typical set-theory properties of collections such as union, intersection. Supports Closure.

Advertisements