Commons Collections 简明教程
Apache Commons Collections - Overview
Commons 集合扩展了 Java 集合框架。它提供了若干功能,以简化集合处理。它提供了许多新的接口、实现和实用工具。
Commons Collections augments Java Collections Framework. It provides several features to make collection handling easy. It provides many new interfaces, implementations and utilities.
Commons 集合的主要功能如下:
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.