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

Method complementOf

corpus/java/training/guava/collect/Sets.java:464–472  ·  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

462 * {@code EnumSet} instance and contains no elements
463 */
464 public static <E extends Enum<E>> EnumSet<E> complementOf(Collection<E> collection) {
465 if (collection instanceof EnumSet) {
466 return EnumSet.complementOf((EnumSet<E>) collection);
467 }
468 checkArgument(
469 !collection.isEmpty(), "collection is empty; use the other version of this method");
470 Class<E> type = collection.iterator().next().getDeclaringClass();
471 return makeComplementByHand(collection, type);
472 }
473
474 /**
475 * 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