4.1. Obtaining Commons Collections
Problem
You need to use Jakarta Commons Collections because your system could benefit from the various functor interfaces and implementations provided by this component.
Solution
You must download the latest version of Commons Collections and place
the Commons Collections JAR in your
project’s classpath. Following the steps outlined in
Recipe 1.1, download Commons Collections
3.0 instead of Commons Lang.
Discussion
Commons Collections was introduced as a series of utilities that
augment the Java Collections API. Commons Collections contains
functors such as Predicate and
Closure, utilities for filtering and selecting
elements in a collection, and some new collections:
Bag and Buffer. Commons
Collections is as widely used as Commons BeanUtils and Commons Lang,
and with these two projects, it forms the core of the Jakarta Commons
components.
If you have a Maven project that needs to use Commons Collections,
add a dependency on Commons Collections 3.0 with the following
section in project.xml:
<dependencies>
<dependency>
<id>commons-collections</id>
<version>3.0</version>
</dependency>
....other dependencies...
</dependencies>See Also
For more information about the Commons Collections project, see the project page at http://jakarta.apache.org/commons/collections. If you have questions about using Commons Collections, feel free to join the http://commons-user@jakarta.apache.org mailing list. Instructions for joining the user mailing list can be found in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access