39 |
|
* |
40 |
|
* <p> The allowed concurrency among update operations is guided by |
41 |
|
* the optional <tt>concurrencyLevel</tt> constructor argument |
42 |
< |
* (default {@value #DEFAULT_CONCURRENCY_LEVEL}), which is used as a hint for internal sizing. The |
42 |
> |
* (default <tt>16</tt>), which is used as a hint for internal sizing. The |
43 |
|
* table is internally partitioned to try to permit the indicated |
44 |
|
* number of concurrent updates without contention. Because placement |
45 |
|
* in hash tables is essentially random, the actual concurrency will |
87 |
|
* The default initial capacity for this table, |
88 |
|
* used when not otherwise specified in a constructor. |
89 |
|
*/ |
90 |
< |
public static final int DEFAULT_INITIAL_CAPACITY = 16; |
90 |
> |
static final int DEFAULT_INITIAL_CAPACITY = 16; |
91 |
|
|
92 |
|
/** |
93 |
|
* The default load factor for this table, used when not |
94 |
|
* otherwise specified in a constructor. |
95 |
|
*/ |
96 |
< |
public static final float DEFAULT_LOAD_FACTOR = 0.75f; |
96 |
> |
static final float DEFAULT_LOAD_FACTOR = 0.75f; |
97 |
|
|
98 |
|
/** |
99 |
|
* The default concurrency level for this table, used when not |
100 |
|
* otherwise specified in a constructor. |
101 |
|
**/ |
102 |
< |
public static final int DEFAULT_CONCURRENCY_LEVEL = 16; |
102 |
> |
static final int DEFAULT_CONCURRENCY_LEVEL = 16; |
103 |
|
|
104 |
|
/** |
105 |
|
* The maximum capacity, used if a higher value is implicitly |
606 |
|
|
607 |
|
/** |
608 |
|
* Creates a new, empty map with the specified initial capacity |
609 |
< |
* and load factor and with the default concurrencyLevel ({@value |
610 |
< |
* #DEFAULT_CONCURRENCY_LEVEL}). |
609 |
> |
* and load factor and with the default concurrencyLevel |
610 |
> |
* (<tt>16</tt>). |
611 |
|
* |
612 |
|
* @param initialCapacity The implementation performs internal |
613 |
|
* sizing to accommodate this many elements. |
621 |
|
|
622 |
|
/** |
623 |
|
* Creates a new, empty map with the specified initial capacity, |
624 |
< |
* and with default load factor ({@value #DEFAULT_LOAD_FACTOR}) |
625 |
< |
* and concurrencyLevel ({@value #DEFAULT_CONCURRENCY_LEVEL}). |
624 |
> |
* and with default load factor (<tt>0.75f</tt>) |
625 |
> |
* and concurrencyLevel (<tt>16</tt>). |
626 |
|
* |
627 |
|
* @param initialCapacity The implementation performs internal |
628 |
|
* sizing to accommodate this many elements. |
635 |
|
|
636 |
|
/** |
637 |
|
* Creates a new, empty map with a default initial capacity |
638 |
< |
* ({@value #DEFAULT_INITIAL_CAPACITY}), load factor ({@value |
639 |
< |
* #DEFAULT_LOAD_FACTOR}), and concurrencyLevel ({@value |
640 |
< |
* #DEFAULT_CONCURRENCY_LEVEL}). |
638 |
> |
* (<tt>16</tt>), load factor |
639 |
> |
* (<tt>0.75f</tt>), and concurrencyLevel |
640 |
> |
* (<tt>16</tt>). |
641 |
|
*/ |
642 |
|
public ConcurrentHashMap() { |
643 |
|
this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL); |
646 |
|
/** |
647 |
|
* Creates a new map with the same mappings as the given map. The |
648 |
|
* map is created with a capacity of 1.5 times the number of |
649 |
< |
* mappings in the given map or {@value #DEFAULT_INITIAL_CAPACITY} |
650 |
< |
* (whichever is greater), and a default load factor ({@value |
651 |
< |
* #DEFAULT_LOAD_FACTOR}) and concurrencyLevel({@value |
652 |
< |
* #DEFAULT_CONCURRENCY_LEVEL}). |
649 |
> |
* mappings in the given map or <tt>16</tt> |
650 |
> |
* (whichever is greater), and a default load factor |
651 |
> |
* (<tt>0.75f</tt>) and concurrencyLevel |
652 |
> |
* (<tt>16</tt>). |
653 |
|
* @param t the map |
654 |
|
*/ |
655 |
|
public ConcurrentHashMap(Map<? extends K, ? extends V> t) { |