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

Method newEnumSet

corpus/java/training/guava/collect/Sets.java:144–149  ·  view source on GitHub ↗

Returns a new, mutable EnumSet instance containing the given elements in their natural order. This method behaves identically to EnumSet#copyOf(Collection), but also accepts non-Collection iterables and empty iterables.

(
      Iterable<E> iterable, Class<E> elementType)

Source from the content-addressed store, hash-verified

142 * accepts non-{@code Collection} iterables and empty iterables.
143 */
144 public static <E extends Enum<E>> EnumSet<E> newEnumSet(
145 Iterable<E> iterable, Class<E> elementType) {
146 EnumSet<E> set = EnumSet.noneOf(elementType);
147 Iterables.addAll(set, iterable);
148 return set;
149 }
150
151 // HashSet
152

Callers

nothing calls this directly

Calls 2

addAllMethod · 0.95
noneOfMethod · 0.45

Tested by

no test coverage detected