MCPcopy Create free account
hub / github.com/antlr/codebuff / complementOf

Method complementOf

output/java_guava/1.4.18/Sets.java:498–505  ·  view source on GitHub ↗

Creates an EnumSet consisting of all enum values that are not in the specified collection. If the collection is an EnumSet, this method has the same behavior as EnumSet#complementOf. Otherwise, the specified collection must contain at least one element, in order to determine

(Collection<E> collection)

Source from the content-addressed store, hash-verified

496
497
498 public static <E extends Enum<E>> EnumSet<E> complementOf(Collection<E> collection) {
499 if (collection instanceof EnumSet) {
500 return EnumSet.complementOf((EnumSet<E>) collection);
501 }
502 checkArgument(!collection.isEmpty(), "collection is empty; use the other version of this method");
503 Class<E> type = collection.iterator().next().getDeclaringClass();
504 return makeComplementByHand(collection, type);
505 }
506
507 /**
508 * Creates an {@code EnumSet} consisting of all enum values that are not in

Callers

nothing calls this directly

Calls 7

makeComplementByHandMethod · 0.95
isEmptyMethod · 0.65
nextMethod · 0.65
iteratorMethod · 0.65
checkArgumentMethod · 0.45
getDeclaringClassMethod · 0.45
checkNotNullMethod · 0.45

Tested by

no test coverage detected