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

Method inferDistinctElements

output/java_guava/1.4.16/Multisets.java:382–387  ·  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

380 */
381
382 static int inferDistinctElements(Iterable<?> elements) {
383 if (elements instanceof Multiset) {
384 return ((Multiset<?>) elements).elementSet().size();
385 }
386 return 11; // initial capacity will be rounded up to 16
387 }
388
389 /**
390 * 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