1225 |
|
public void clear() { |
1226 |
|
ConcurrentHashMap.this.clear(); |
1227 |
|
} |
1228 |
+ |
public Object[] toArray() { |
1229 |
+ |
Collection<K> c = new ArrayList<K>(); |
1230 |
+ |
for (Iterator<K> i = iterator(); i.hasNext(); ) |
1231 |
+ |
c.add(i.next()); |
1232 |
+ |
return c.toArray(); |
1233 |
+ |
} |
1234 |
+ |
public <T> T[] toArray(T[] a) { |
1235 |
+ |
Collection<K> c = new ArrayList<K>(); |
1236 |
+ |
for (Iterator<K> i = iterator(); i.hasNext(); ) |
1237 |
+ |
c.add(i.next()); |
1238 |
+ |
return c.toArray(a); |
1239 |
+ |
} |
1240 |
|
} |
1241 |
|
|
1242 |
|
final class Values extends AbstractCollection<V> { |
1252 |
|
public void clear() { |
1253 |
|
ConcurrentHashMap.this.clear(); |
1254 |
|
} |
1255 |
+ |
public Object[] toArray() { |
1256 |
+ |
Collection<V> c = new ArrayList<V>(); |
1257 |
+ |
for (Iterator<V> i = iterator(); i.hasNext(); ) |
1258 |
+ |
c.add(i.next()); |
1259 |
+ |
return c.toArray(); |
1260 |
+ |
} |
1261 |
+ |
public <T> T[] toArray(T[] a) { |
1262 |
+ |
Collection<V> c = new ArrayList<V>(); |
1263 |
+ |
for (Iterator<V> i = iterator(); i.hasNext(); ) |
1264 |
+ |
c.add(i.next()); |
1265 |
+ |
return c.toArray(a); |
1266 |
+ |
} |
1267 |
|
} |
1268 |
|
|
1269 |
|
final class EntrySet extends AbstractSet<Map.Entry<K,V>> { |