This Set implementation is specialized for use
with enumerated constants. The element type
E must be an enumerated type, and
null is not allowed as a member of the set.
EnumSet does not define a constructor. Instead, it
defines various static factory methods for creating sets. Use one of
the of( ) methods for creating an
EnumSet and initializing its elements. For
efficiency, versions of this method that accept one through five
arguments are defined. If you pass more than five arguments, the
varargs version will be invoked. The allOf( ) and
noneOf( ) methods define full and empty sets but
require the Class of the enumerated type since
they do not have any other arguments to define the element type.
complementOf( ) returns an
EnumSet that contains all enumerated constants not
contained by the specified EnumSet. The
range( ) factory creates a set that includes the
two specified values and any enumerated constants that fall between
them in the enumerated type declaration. (Note that this definition
of a range includes both endpoints and differs from most Java
methods, in which the second argument specifies the first value past
the end of the range.)
The EnumSet implementation is based on a bit
vector that includes one bit for each constant defined by the
enumerated type E. Because of this compact
and efficient representation, basic Set operations
occur in constant time, and the Iterator returns
enumerated constants in the order in which they are declared in the
type E. EnumSet is not
threadsafe, but the Iterator uses a copy of the
internal bit vector and never throws
ConcurrentModificationException.

public abstract class EnumSet<E extends Enum<E>>
extends AbstractSet<E> implements Cloneable, Serializable {
// No Constructor
// Public Class Methods
public static <E extends Enum<E>> EnumSet<E> allOf(Class<E> elementType);
public static <E extends Enum<E>> EnumSet<E> complementOf(EnumSet<E> s);
public static <E extends Enum<E>> EnumSet<E> copyOf(EnumSet<E> s);
public static <E extends Enum<E>> EnumSet<E> copyOf(Collection<E> c);
public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType);
public static <E extends Enum<E>> EnumSet<E> of(E e);
public static <E extends Enum<E>> EnumSet<E> of(E first, E ... rest);
public static <E extends Enum<E>> EnumSet<E> of(E e1, E e2);
public static <E extends Enum<E>> EnumSet<E> of(E e1, E e2, E e3);
public static <E extends Enum<E>> EnumSet<E> of(E e1, E e2, E e3, E e4);
public static <E extends Enum<E>> EnumSet<E> of(E e1, E e2, E e3, E e4, E e5);
public static <E extends Enum<E>> EnumSet<E> range(E from, E to);
// Public Instance Methods
public EnumSet<E> clone( );
}