SetMixin<E> typedef
Mixin implementation of Set.
This class provides a base implementation of a Set
that depends only
on the abstract members: add, contains, lookup, remove,
iterator, length and toSet.
Some of the methods assume that toSet
creates a modifiable set.
If using this mixin for an unmodifiable set,
where toSet
should return an unmodifiable set,
it's necessary to reimplement
retainAll, union, intersection and difference.
Implementations of Set
using this mixin should consider also implementing
clear
in constant time. The default implementation works by removing every
element.
Implementation
// TODO: @Deprecated("Use SetBase instead")
// Longer term: Deprecate `Set` unnamed constructor, to allow using `Set`
// as skeleton class and replace `SetBase`.
typedef SetMixin<E> = SetBase<E>;