1120 |
|
/** |
1121 |
|
* Custom Entry class used by EntryIterator.next(), that relays |
1122 |
|
* setValue changes to the underlying map. |
1123 |
< |
*/ |
1123 |
> |
*/ |
1124 |
|
static final class WriteThroughEntry<K,V> extends AbstractMap.SimpleEntry<K,V> { |
1125 |
|
private final ConcurrentHashMap<K,V> map; |
1126 |
< |
WriteThroughEntry(ConcurrentHashMap map, K k, V v) { |
1127 |
< |
super(k,v); |
1126 |
> |
WriteThroughEntry(ConcurrentHashMap map, K k, V v) { |
1127 |
> |
super(k,v); |
1128 |
|
this.map = map; |
1129 |
|
} |
1130 |
|
|
1148 |
|
final class EntryIterator extends HashIterator implements Iterator<Entry<K,V>> { |
1149 |
|
public Map.Entry<K,V> next() { |
1150 |
|
HashEntry<K,V> e = super.nextEntry(); |
1151 |
< |
return new WriteThroughEntry<K,V>(ConcurrentHashMap.this, |
1151 |
> |
return new WriteThroughEntry<K,V>(ConcurrentHashMap.this, |
1152 |
|
e.key, e.value); |
1153 |
|
} |
1154 |
|
} |