RELEASE NOTES: COLLECTIONS 3.0
Collections 3.0 includes a significant number of new collections
in addition to various bug fixes and refactoring changes. The major additions
are:
- Buffers - A new collection interface for queues and
queue-like things.
- Decorators - A group of static utility classes that provide
decorators for other collections
The decorators are found on classes named XxxUtils
where Xxx is the
collection type. The decorators are:
- Synchronized - Synchronized decorators where not provided
by
Collections
.
- Unmodifiable - Unmodifiable decorators where not provided
by
Collections
.
- Predicated - Decorators that only allow the addition of an
element to the collection if it matches a
Predicate
.
- FixedSize - Decorators that ensure that the list/map
cannot change size.
- Lazy - Decorators that create objects on demand using a
Factory
.
Access to Iterators and Comparators has also been brought in line, by the provision
of IteratorUtils
and ComparatorUtils
.
NEW COLLECTIONS, COMPARATORS, ITERATORS AND UTILITY CLASSES
These collections are new to Collections 3.0:
These comparators are new to Collections 2.1:
These iterators are new to Collections 2.1:
- ArrayListIterator - Provides a ListIterator over an array
of any type (including primitive arrays).
- LoopingIterator - Provides an Iterator that loops repeatedly
over the collection.
- ObjectArrayIterator/ListIterator -
Provides iterators over an Object array.
- ResetableIterator/ListIterator -
Interface that defines a reset() method to reset the iterator back to the start.
These are the new utility classes:
CHANGED CLASSES
These iterators have changed since Collections 2.1:
- ArrayIterator -
This now implements the ResetableIterator interface. It also supports a start index to iterate from.
- CollatingIterator -
The remove() method now throws IllegalStateException not NoSuchElementException.
- FilterIterator -
The remove() method is now supported, with some limitations.
- IteratorChain -
Bug fix for when remove() called before hasNext()/next().
- SingletonIterator/ListIterator -
These now implement the ResetableIterator interface.
REFACTORING
Documentation
Every class released in 3.0 has been changed in some way.
This might be simply the update to the Apache license, or it could be improved Javadoc.