199 |
|
this.value = value; |
200 |
|
} |
201 |
|
|
202 |
< |
@SuppressWarnings("unchecked") |
203 |
< |
static final <K,V> HashEntry<K,V>[] newArray(int i) { |
204 |
< |
return new HashEntry[i]; |
205 |
< |
} |
202 |
> |
@SuppressWarnings("unchecked") |
203 |
> |
static final <K,V> HashEntry<K,V>[] newArray(int i) { |
204 |
> |
return new HashEntry[i]; |
205 |
> |
} |
206 |
|
} |
207 |
|
|
208 |
|
/** |
290 |
|
setTable(HashEntry.<K,V>newArray(initialCapacity)); |
291 |
|
} |
292 |
|
|
293 |
< |
@SuppressWarnings("unchecked") |
293 |
> |
@SuppressWarnings("unchecked") |
294 |
|
static final <K,V> Segment<K,V>[] newArray(int i) { |
295 |
< |
return new Segment[i]; |
295 |
> |
return new Segment[i]; |
296 |
|
} |
297 |
|
|
298 |
|
/** |
918 |
|
* @throws NullPointerException if the specified key is null |
919 |
|
*/ |
920 |
|
public V remove(Object key) { |
921 |
< |
int hash = hash(key.hashCode()); |
921 |
> |
int hash = hash(key.hashCode()); |
922 |
|
return segmentFor(hash).remove(key, hash, null); |
923 |
|
} |
924 |
|
|
1110 |
|
} |
1111 |
|
|
1112 |
|
final class KeyIterator |
1113 |
< |
extends HashIterator |
1114 |
< |
implements Iterator<K>, Enumeration<K> |
1113 |
> |
extends HashIterator |
1114 |
> |
implements Iterator<K>, Enumeration<K> |
1115 |
|
{ |
1116 |
|
public K next() { return super.nextEntry().key; } |
1117 |
|
public K nextElement() { return super.nextEntry().key; } |
1118 |
|
} |
1119 |
|
|
1120 |
|
final class ValueIterator |
1121 |
< |
extends HashIterator |
1122 |
< |
implements Iterator<V>, Enumeration<V> |
1121 |
> |
extends HashIterator |
1122 |
> |
implements Iterator<V>, Enumeration<V> |
1123 |
|
{ |
1124 |
|
public V next() { return super.nextEntry().value; } |
1125 |
|
public V nextElement() { return super.nextEntry().value; } |
1130 |
|
* setValue changes to the underlying map. |
1131 |
|
*/ |
1132 |
|
final class WriteThroughEntry |
1133 |
< |
extends AbstractMap.SimpleEntry<K,V> |
1133 |
> |
extends AbstractMap.SimpleEntry<K,V> |
1134 |
|
{ |
1135 |
|
WriteThroughEntry(K k, V v) { |
1136 |
|
super(k,v); |
1145 |
|
* removed in which case the put will re-establish). We do not |
1146 |
|
* and cannot guarantee more. |
1147 |
|
*/ |
1148 |
< |
public V setValue(V value) { |
1148 |
> |
public V setValue(V value) { |
1149 |
|
if (value == null) throw new NullPointerException(); |
1150 |
|
V v = super.setValue(value); |
1151 |
|
ConcurrentHashMap.this.put(getKey(), value); |
1154 |
|
} |
1155 |
|
|
1156 |
|
final class EntryIterator |
1157 |
< |
extends HashIterator |
1158 |
< |
implements Iterator<Entry<K,V>> |
1157 |
> |
extends HashIterator |
1158 |
> |
implements Iterator<Entry<K,V>> |
1159 |
|
{ |
1160 |
|
public Map.Entry<K,V> next() { |
1161 |
|
HashEntry<K,V> e = super.nextEntry(); |