Sets the minimum total size for the internal hash tables. For example, if the initial capacity is 60, and the concurrency level is 8, then eight segments are created, each having a hash table of size eight. Providing a large enough estimate at construction time avoids the need for ex
(int initialCapacity)
| 148 | */ |
| 149 | |
| 150 | @CanIgnoreReturnValue |
| 151 | public MapMaker initialCapacity(int initialCapacity) { |
| 152 | checkState(this.initialCapacity == UNSET_INT, |
| 153 | "initial capacity was already set to %s", |
| 154 | this.initialCapacity); |
| 155 | checkArgument(initialCapacity >= 0); |
| 156 | this.initialCapacity = initialCapacity; |
| 157 | return this; |
| 158 | } |
| 159 | |
| 160 | int getInitialCapacity() { |
| 161 | return (initialCapacity == UNSET_INT) ? DEFAULT_INITIAL_CAPACITY : initialCapacity; |
no test coverage detected