RELEASE NOTES: COLLECTIONS 2.0

NEW COLLECTIONS AND COMPARATORS

Collections 2.0 includes a significant number of new collections, in addition to several useful Comparator classes. Descriptions of the new collections and comparators follow. (For descriptions of all classes in Collections, see the STATUS.html file.)

These collections are new to Collections 2.0:

These are the new Comparator classes:

CHANGED COLLECTIONS

These classes have changed since Collections 1.0:

ArrayEnumeration

ArrayEnumeration has been deprecated. This class has significant overlap with ArrayIterator, and Collections focuses mainly on Java2-style collections. If you need to enumerate an array, create an ArrayIterator and wrap it with an IteratorEnumeration instead.

ArrayIterator

Bugs fixed:

LRUMap

LRUMap has been reimplemented as a subclass of SynchronizedHashMap. The new implementation of LRUMap should be faster, and it also offers true LRU capabilities; now any get(Object) or put(Object,Object) from this collection promotes the key to the Most Recently Used position.

LRUMap 2.0 compatibility changes:

New features:

Bugs fixed:

BeanMap

BeanMap's entrySet() now properly returns a set containing Map.Entry objects. Previously, entrySet() was equivalent to keySet() (returns a set of the readable properties) and there was no mechanism to retrieve all of the readable properties along with their values. Additionally, the BeanMap clone method has been revamped to work better for subclasses.

BeanMap 2.0 compatibility changes:

Bugs fixed:

PriorityQueue

Changed to allow priority queue implementations that support determining priorities using means other than the object's natural ordering (i.e. a priority queue that does not depend on the object implementing the Comparable interface).

PriorityQueue 2.0 compatibility changes:

BinaryHeap

Changed to allow the specification of a Comparator that should be used to compare objects to determine "priority" of the objects. If no comparator is specified, the object's natural ordering is used.

BinaryHeap 2.0 compatibility changes:

New features: