Lines Matching refs:EnumSet

41 import java.util.EnumSet;
69 * Internally, the returned set will be backed by an {@link EnumSet}.
82 return new ImmutableEnumSet<E>(EnumSet.of(anElement, otherElements));
87 * Internally, the returned set will be backed by an {@link EnumSet}.
104 if (elements instanceof EnumSet) {
105 EnumSet<E> enumSetClone = EnumSet.copyOf((EnumSet<E>) elements);
109 EnumSet<E> set = EnumSet.of(first);
117 * Returns a new {@code EnumSet} instance containing the given elements.
118 * Unlike {@link EnumSet#copyOf(Collection)}, this method does not produce an
122 public static <E extends Enum<E>> EnumSet<E> newEnumSet(Iterable<E> iterable,
138 EnumSet<E> set = EnumSet.noneOf(elementType);
152 * EnumSet#noneOf} instead.
169 * EnumSet#of(Enum, Enum[])} instead.
224 * {@link EnumSet} instead.
362 * Creates an {@code EnumSet} consisting of all enum values that are not in
363 * the specified collection. If the collection is an {@link EnumSet}, this
364 * method has the same behavior as {@link EnumSet#complementOf}. Otherwise,
371 * @return a new, modifiable {@code EnumSet} containing all values of the enum
374 * {@code EnumSet} instance and contains no elements
376 public static <E extends Enum<E>> EnumSet<E> complementOf(
378 if (collection instanceof EnumSet) {
379 return EnumSet.complementOf((EnumSet<E>) collection);
388 * Creates an {@code EnumSet} consisting of all enum values that are not in
390 * {@link EnumSet#complementOf}, but can act on any input collection, as long
394 * {@code EnumSet}
396 * @return a new, modifiable {@code EnumSet} initially containing all the
399 public static <E extends Enum<E>> EnumSet<E> complementOf(
402 return (collection instanceof EnumSet)
403 ? EnumSet.complementOf((EnumSet<E>) collection)
407 private static <E extends Enum<E>> EnumSet<E> makeComplementByHand(
409 EnumSet<E> result = EnumSet.allOf(type);