Java apache commons-collections 库介绍


#Java Apache Commons 库#


简介

官方网站: https://commons.apache.org/proper/commons-collections/

该库的定位:

The Java Collections Framework was a major addition in JDK 1.2. It added many powerful data structures that accelerate development of most significant Java applications. Since that time it has become the recognised standard for collection handling in Java.

Commons-Collections seek to build upon the JDK classes by providing new interfaces, implementations and utilities. There are many features, including:

Bag interface for collections that have a number of copies of each object BidiMap interface for maps that can be looked up from value to key as well and key to value MapIterator interface to provide simple and quick iteration over maps Transforming decorators that alter each object as it is added to the collection Composite collections that make multiple collections look like one Ordered maps and sets that retain the order elements are added in, including an LRU based map Reference map that allows keys and/or values to be garbage collected under close control Many comparator implementations Many iterator implementations Adapter classes from array and enumerations to collections Utilities to test or create typical set-theory properties of collections such as union, intersection, and closure

截至 2022-05-11:

  • 4.xx 的最新版本是 4.4 。package 前缀是 org.apache.commons.collections4 。
  • 3.xx 的最新版本是 3.2.2 。package 前缀是 org.apache.commons.collections 。
  • 2.xx 的最新版本是 2.1.1 。package 前缀是 org.apache.commons.collections 。不建议使用该大版本。

引入包

gradle 引入依赖:

implementation group: 'commons-collections', name: 'commons-collections', version: '3.2.2'

( 本文完 )