The Apache Jakarta Project has released
Commons Collections 3.2, an open source library that extends and augments the
Java Collections Framework.
It includes:
- Bag interface for collections that have a number of copies of each object
- Buffer interface for collections that have a well defined removal order, like FIFOs
- 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
- Type checking decorators to ensure that only instances of a certain type can be added
- 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
- Identity map that compares objects based on their identity (==) instead of the equals method
- 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
Version 3.2 is backwards compatible with 3.1. New classes include
MultiValueMap
A flexible MultiMap implementation
DefaultedMap
A map that returns a default value when the key is not found
GrowthList
A list where set and add expand the list rather than throw IndexOutOfBoundsException
LoopingListIterator
A never-ending list iterator
CollectionUtils.addIgnoreNull
Adds to the collection if the value being added is not null
isEmpty
Checks maps and collections for empty or null
BlockingBuffer
Add timeout handling to any buffer implementation
ListOrderedMap
additional list-style methods
And of course bugs have been fixed.