1213 |
|
*/ |
1214 |
|
public KeySetView<K,V> keySet() { |
1215 |
|
KeySetView<K,V> ks; |
1216 |
< |
return (ks = keySet) != null ? ks : (keySet = new KeySetView<K,V>(this, null)); |
1216 |
> |
if ((ks = keySet) != null) return ks; |
1217 |
> |
return keySet = new KeySetView<K,V>(this, null); |
1218 |
|
} |
1219 |
|
|
1220 |
|
/** |
1237 |
|
*/ |
1238 |
|
public Collection<V> values() { |
1239 |
|
ValuesView<K,V> vs; |
1240 |
< |
return (vs = values) != null ? vs : (values = new ValuesView<K,V>(this)); |
1240 |
> |
if ((vs = values) != null) return vs; |
1241 |
> |
return values = new ValuesView<K,V>(this); |
1242 |
|
} |
1243 |
|
|
1244 |
|
/** |
1260 |
|
*/ |
1261 |
|
public Set<Map.Entry<K,V>> entrySet() { |
1262 |
|
EntrySetView<K,V> es; |
1263 |
< |
return (es = entrySet) != null ? es : (entrySet = new EntrySetView<K,V>(this)); |
1263 |
> |
if ((es = entrySet) != null) return es; |
1264 |
> |
return entrySet = new EntrySetView<K,V>(this); |
1265 |
|
} |
1266 |
|
|
1267 |
|
/** |
2532 |
|
* A padded cell for distributing counts. Adapted from LongAdder |
2533 |
|
* and Striped64. See their internal docs for explanation. |
2534 |
|
*/ |
2535 |
< |
@jdk.internal.vm.annotation.Contended static final class CounterCell { |
2535 |
> |
@sun.misc.Contended static final class CounterCell { |
2536 |
|
volatile long value; |
2537 |
|
CounterCell(long x) { value = x; } |
2538 |
|
} |
3432 |
|
|
3433 |
|
static final class KeyIterator<K,V> extends BaseIterator<K,V> |
3434 |
|
implements Iterator<K>, Enumeration<K> { |
3435 |
< |
KeyIterator(Node<K,V>[] tab, int index, int size, int limit, |
3435 |
> |
KeyIterator(Node<K,V>[] tab, int size, int index, int limit, |
3436 |
|
ConcurrentHashMap<K,V> map) { |
3437 |
< |
super(tab, index, size, limit, map); |
3437 |
> |
super(tab, size, index, limit, map); |
3438 |
|
} |
3439 |
|
|
3440 |
|
public final K next() { |
3452 |
|
|
3453 |
|
static final class ValueIterator<K,V> extends BaseIterator<K,V> |
3454 |
|
implements Iterator<V>, Enumeration<V> { |
3455 |
< |
ValueIterator(Node<K,V>[] tab, int index, int size, int limit, |
3455 |
> |
ValueIterator(Node<K,V>[] tab, int size, int index, int limit, |
3456 |
|
ConcurrentHashMap<K,V> map) { |
3457 |
< |
super(tab, index, size, limit, map); |
3457 |
> |
super(tab, size, index, limit, map); |
3458 |
|
} |
3459 |
|
|
3460 |
|
public final V next() { |
3472 |
|
|
3473 |
|
static final class EntryIterator<K,V> extends BaseIterator<K,V> |
3474 |
|
implements Iterator<Map.Entry<K,V>> { |
3475 |
< |
EntryIterator(Node<K,V>[] tab, int index, int size, int limit, |
3475 |
> |
EntryIterator(Node<K,V>[] tab, int size, int index, int limit, |
3476 |
|
ConcurrentHashMap<K,V> map) { |
3477 |
< |
super(tab, index, size, limit, map); |
3477 |
> |
super(tab, size, index, limit, map); |
3478 |
|
} |
3479 |
|
|
3480 |
|
public final Map.Entry<K,V> next() { |