Java Reference
In-Depth Information
public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E>
enumType)
Creates an empty EnumSet that can contain elements of the
given enum type.
public static <E extends Enum<E>> EnumSet<E> copyOf(EnumSet<E> set)
Creates an EnumSet of the same enum type as set and contain-
ing all the elements of set .
public static <E extends Enum<E>> EnumSet<E> complementOf(EnumSet<E>
set)
Creates an EnumSet of the same enum type as set and contain-
ing all the enum constants that are not contained in set .
public static <E extends Enum<E>> EnumSet<E> copyOf(Collection<E>
coll)
Creates an EnumSet from the given collection. If the collection
is an EnumSet , a copy is returned. Any other collection must
contain one or more elements, all of which are constants from
the same enum; this enum will be the enum type of the re-
turned EnumSet . If coll is empty and is not an EnumSet then Il-
legalArgumentException is thrown because there is no specified
enum type for this set.
The of method creates an enum set containing the given enum constant.
It has five overloaded forms that take one through five elements as ar-
guments. For example, here is the form that takes three elements:
public static <E extends Enum<E>> EnumSet<E> of(E e1, E e2, E e3)
Creates an EnumSet containing e1 , e2 , and e3 .
A sixth overload takes an arbitrary number of elements:
 
Search WWH ::




Custom Search