This package contains implementations of the
{@link java.util.Set Set} and
{@link java.util.SortedSet SortedSet} interfaces.
The implementations are in the form of direct implementations and decorators.
A decorator wraps another implementation of the interface to add some
specific additional functionality.
The following implementations are provided in the package:
CompositeSet - a set that combines multiple sets into one
The following decorators are provided in the package:
Synchronized - synchronizes method access for multi-threaded environments
Unmodifiable - ensures the collection cannot be altered
Predicated - ensures that only elements that are valid according to a predicate can be added
Typed - ensures that only elements that are of a specific type can be added
Transformed - transforms each element added
ListOrdered - ensures that insertion order is retained
Abstract test class for
Set methods and contracts.
Since
Set doesn't stipulate much new behavior that isn't already
found in
Collection , this class basically just adds tests for
Set.equals and
Set.hashCode along with an updated
AbstractTestSet.verify() that ensures elements do not appear more than once in the
set.
Decorates another Set to ensure that the order of addition
is retained and used by the iterator.
If an object is added to the set for a second time, it will remain in the
original position in the iteration.
The order can be observed from the set via the iterator or toArray methods.
The ListOrderedSet also has various useful direct methods.