range

inline fun <E : Enum<E>> range(from: E, to: E): EnumSet<E>

Creates an enum set initially containing all of the elements in the range defined by the two specified endpoints. The returned set will contain the endpoints themselves, which may be identical but must not be out of order.

Return

an enum set initially containing all of the elements in the range defined by the two specified endpoints

Parameters

The class of the parameter elements and of the set
from

the first element in the range

to

the last element in the range

Throws

if from or to are null

if from.compareTo(to) > 0