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

Method inferDistinctElements

output/java_guava/1.4.19/Multisets.java:381–386  ·  view source on GitHub ↗

Returns the expected number of distinct elements given the specified elements. The number of distinct elements is only computed if elements is an instance of Multiset; otherwise the default value of 11 is returned.

(Iterable<?> elements)

Source from the content-addressed store, hash-verified

379 */
380
381 static int inferDistinctElements(Iterable<?> elements) {
382 if (elements instanceof Multiset) {
383 return ((Multiset<?>) elements).elementSet().size();
384 }
385 return 11; // initial capacity will be rounded up to 16
386 }
387
388 /**
389 * Returns an unmodifiable view of the union of two multisets.

Callers 2

createMethod · 0.95
createMethod · 0.95

Calls 2

sizeMethod · 0.65
elementSetMethod · 0.65

Tested by

no test coverage detected