EnumSet<T extends Enum>.of constructor
Creates a new EnumSet which holds the specified elements of a given Enum.
A list of all possible enum values must be provided to the factory
constructor's parameter all
. The provided elements must be passed to the
parameter elements
as an Iterable.
Example:
enum Numbers { one, two, three; }
EnumSet<Numbers>.of(Numbers.values, [Numbers.one]);
Implementation
factory EnumSet.of(List<T> all, Iterable<T> elements) {
if (all.length <= maxBitsInt) {
return _BaseEnumSetImpl<T>(all, elements);
} else {
return _LargeEnumSetImpl<T>(all, elements);
}
}