MCPcopy Index your code
hub / github.com/antlr/codebuff / newHashMapWithExpectedSize

Method newHashMapWithExpectedSize

output/java_guava/1.4.18/Maps.java:194–196  ·  view source on GitHub ↗

Creates a HashMap instance, with a high enough "initial capacity" that it should hold expectedSize elements without growth. This behavior cannot be broadly guaranteed, but it is observed to be true for OpenJDK 1.7. It also can't be guaranteed that the method isn't inadvertentl

(int expectedSize)

Source from the content-addressed store, hash-verified

192
193
194 public static <K, V> HashMap<K, V> newHashMapWithExpectedSize(int expectedSize) {
195 return new HashMap<K, V>(capacity(expectedSize));
196 }
197
198 /**
199 * Returns a capacity that is sufficient to keep the map from being resized as

Callers 10

createMapMethod · 0.95
HashMultisetMethod · 0.95
ofMethod · 0.95
ArrayListMultimapMethod · 0.95
ofMethod · 0.95
HashMultimapMethod · 0.95
ofMethod · 0.95
EnumHashBiMapMethod · 0.95
getMethod · 0.95
createMethod · 0.95

Calls 1

capacityMethod · 0.95

Tested by

no test coverage detected