SetMixin typedef - dart:collection library (original) (raw)

SetMixin<E> = SetBase<E>

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 reimplementretainAll, union, intersection and difference.

Implementations of Set using this mixin should consider also implementingclear 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>;