RELEASE NOTES: COLLECTIONS 3.0
Collections 3.0 includes a lot of new functionality, including new interfaces
and new implementations in addition to various bug fixes and refactoring changes.
The major additions are:
- Bidirectional maps -
New interface and implementations for maps that need bidirectional lookup.
- Map iterator -
New interface to enable iteration over map keys and values in one easy step.
- Observable collections -
New collection decorators that allow changes to collections to be observed via listeners.
- Decorators -
An entire package of classes that decorate existing collections/maps to add functionality.
This includes fixed size, lazy loading, validating, unmodifiable, synchronized, bounded,
transforming and ordered.
- Functors -
A default set of functor implementations is now provided for Predicate, Transformer,
Closure and Factory.
- Pairs -
A new package full of key-value pairs and map entry implementations.
All previously deprecated classes have been removed.
NEW PACKAGES
These packages are new to Collections 3.0:
- decorators -
Package of classes that decorate other collections/maps. Some of these classes
were previously inner classes, others are new.
- observed -
Package of classes that enable changes to collections/maps to be observed.
- pairs -
Package of key-value pairs and map entries.
NEW CLASSES
These collections are new to Collections 3.0:
These comparators are new to Collections 3.0:
- BooleanIterator -
Provides a comparator over Boolean instances.
- FixedOrderIterator -
Provides an iterator in a fixed pre-determined order.
These iterators are new to Collections 3.0:
- MapIterator -
Interface that defines a simple and powerful way to iterate over a Map.
- Resetable*Iterator -
Interfaces that defines a reset() method to reset the iterator back to the start.
- ArrayListIterator -
Provides a ListIterator over an array of any type (including primitive arrays).
- LoopingIterator -
Provides an Iterator that loops repeatedly over the collection.
- ObjectArray*Iterator -
Provides iterators over an Object array.
- Abstract*IteratorDecorator -
Provides abstract decorators that can be used to build extra functionality.
- Unmodifiable*Iterator -
Provides decorators for iterators that are unmodifiable.
These are the new utility classes:
CHANGED CLASSES
These comparators have changed since Collections 3.0:
- ComparableComparator -
Simpler implementation that respects interface better.
- ComparatorChain -
Equals and HashCode added.
- ReverseComparator -
Equals and HashCode added.
These iterators have changed since Collections 3.0:
- 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().
- Singleton*Iterator -
These now implement the ResetableIterator interface.
- Proxy*Iterator -
Now deprecated in favour of AbstractIteratorDecorator/AbstractListIteratorDecorator.
- Filter*Iterator/TransformIterator -
No longer extend ProxyIterator.
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.