54 |
|
* <p> Resizing this or any other kind of hash table is a relatively |
55 |
|
* slow operation, so, when possible, it is a good idea to provide |
56 |
|
* estimates of expected table sizes in constructors. Also, for |
57 |
< |
* compatability with previous versions of this class, constructors |
57 |
> |
* compatibility with previous versions of this class, constructors |
58 |
|
* may optionally specify an expected {@code concurrencyLevel} as an |
59 |
|
* additional hint for internal sizing. |
60 |
|
* |
192 |
|
* in 8 puts check threshold (and after resizing, many fewer do |
193 |
|
* so). But this approximation has high variance for small table |
194 |
|
* sizes, so we check on any collision for sizes <= 64. Further, |
195 |
< |
* to increase the probablity that a resize occurs soon enough, we |
195 |
> |
* to increase the probability that a resize occurs soon enough, we |
196 |
|
* offset the threshold (see THRESHOLD_OFFSET) by the expected |
197 |
|
* number of puts between checks. This is currently set to 8, in |
198 |
|
* accord with the default load factor. In practice, this is |
199 |
|
* rarely overridden, and in any case is close enough to other |
200 |
< |
* plausible values not to waste dynamic probablity computation |
200 |
> |
* plausible values not to waste dynamic probability computation |
201 |
|
* for more precision. |
202 |
|
*/ |
203 |
|
|
234 |
|
static final int DEFAULT_CONCURRENCY_LEVEL = 16; |
235 |
|
|
236 |
|
/** |
237 |
< |
* The count value to offset thesholds to compensate for checking |
237 |
> |
* The count value to offset thresholds to compensate for checking |
238 |
|
* for resizing only when inserting into bins with two or more |
239 |
|
* elements. See above for explanation. |
240 |
|
*/ |
271 |
|
transient Set<Map.Entry<K,V>> entrySet; |
272 |
|
transient Collection<V> values; |
273 |
|
|
274 |
< |
/** For serialization compatability. Null unless serialized; see below */ |
274 |
> |
/** For serialization compatibility. Null unless serialized; see below */ |
275 |
|
Segment<K,V>[] segments; |
276 |
|
|
277 |
|
/** |
309 |
|
} |
310 |
|
|
311 |
|
/* |
312 |
< |
* Volatile access nethods are used for table elements as well as |
312 |
> |
* Volatile access methods are used for table elements as well as |
313 |
|
* elements of in-progress next table while resizing. Uses in |
314 |
|
* access and update methods are null checked by callers, and |
315 |
|
* implicitly bounds-checked, relying on the invariants that tab |