Lines Matching refs:EnumSet

38 import java.util.EnumSet;
66 * Internally, the returned set will be backed by an {@link EnumSet}.
79 return new ImmutableEnumSet<E>(EnumSet.of(anElement, otherElements));
84 * Internally, the returned set will be backed by an {@link EnumSet}.
101 if (elements instanceof EnumSet) {
102 EnumSet<E> enumSetClone = EnumSet.copyOf((EnumSet<E>) elements);
106 EnumSet<E> set = EnumSet.of(first);
114 * Returns a new {@code EnumSet} instance containing the given elements.
115 * Unlike {@link EnumSet#copyOf(Collection)}, this method does not produce an
119 public static <E extends Enum<E>> EnumSet<E> newEnumSet(Iterable<E> iterable,
135 EnumSet<E> set = EnumSet.noneOf(elementType);
149 * EnumSet#noneOf} instead.
166 * EnumSet#of(Enum, Enum[])} instead.
221 * {@link EnumSet} instead.
359 * Creates an {@code EnumSet} consisting of all enum values that are not in
360 * the specified collection. If the collection is an {@link EnumSet}, this
361 * method has the same behavior as {@link EnumSet#complementOf}. Otherwise,
368 * @return a new, modifiable {@code EnumSet} containing all values of the enum
371 * {@code EnumSet} instance and contains no elements
373 public static <E extends Enum<E>> EnumSet<E> complementOf(
375 if (collection instanceof EnumSet) {
376 return EnumSet.complementOf((EnumSet<E>) collection);
385 * Creates an {@code EnumSet} consisting of all enum values that are not in
387 * {@link EnumSet#complementOf}, but can act on any input collection, as long
391 * {@code EnumSet}
393 * @return a new, modifiable {@code EnumSet} initially containing all the
396 public static <E extends Enum<E>> EnumSet<E> complementOf(
399 return (collection instanceof EnumSet)
400 ? EnumSet.complementOf((EnumSet<E>) collection)
404 private static <E extends Enum<E>> EnumSet<E> makeComplementByHand(
406 EnumSet<E> result = EnumSet.allOf(type);