1176 |
|
public void clear() { |
1177 |
|
ConcurrentHashMap.this.clear(); |
1178 |
|
} |
1179 |
– |
public Object[] toArray() { |
1180 |
– |
Collection<K> c = new ArrayList<K>(size()); |
1181 |
– |
for (K k : this) |
1182 |
– |
c.add(k); |
1183 |
– |
return c.toArray(); |
1184 |
– |
} |
1185 |
– |
public <T> T[] toArray(T[] a) { |
1186 |
– |
Collection<K> c = new ArrayList<K>(); |
1187 |
– |
for (K k : this) |
1188 |
– |
c.add(k); |
1189 |
– |
return c.toArray(a); |
1190 |
– |
} |
1179 |
|
} |
1180 |
|
|
1181 |
|
final class Values extends AbstractCollection<V> { |
1191 |
|
public void clear() { |
1192 |
|
ConcurrentHashMap.this.clear(); |
1193 |
|
} |
1206 |
– |
public Object[] toArray() { |
1207 |
– |
Collection<V> c = new ArrayList<V>(size()); |
1208 |
– |
for (V v : this) |
1209 |
– |
c.add(v); |
1210 |
– |
return c.toArray(); |
1211 |
– |
} |
1212 |
– |
public <T> T[] toArray(T[] a) { |
1213 |
– |
Collection<V> c = new ArrayList<V>(size()); |
1214 |
– |
for (V v : this) |
1215 |
– |
c.add(v); |
1216 |
– |
return c.toArray(a); |
1217 |
– |
} |
1194 |
|
} |
1195 |
|
|
1196 |
|
final class EntrySet extends AbstractSet<Map.Entry<K,V>> { |
1216 |
|
public void clear() { |
1217 |
|
ConcurrentHashMap.this.clear(); |
1218 |
|
} |
1243 |
– |
public Object[] toArray() { |
1244 |
– |
Collection<Map.Entry<K,V>> c = new ArrayList<Map.Entry<K,V>>(size()); |
1245 |
– |
for (Map.Entry<K,V> e : this) |
1246 |
– |
c.add(e); |
1247 |
– |
return c.toArray(); |
1248 |
– |
} |
1249 |
– |
public <T> T[] toArray(T[] a) { |
1250 |
– |
Collection<Map.Entry<K,V>> c = new ArrayList<Map.Entry<K,V>>(size()); |
1251 |
– |
for (Map.Entry<K,V> e : this) |
1252 |
– |
c.add(e); |
1253 |
– |
return c.toArray(a); |
1254 |
– |
} |
1255 |
– |
|
1219 |
|
} |
1220 |
|
|
1221 |
|
/* ---------------- Serialization Support -------------- */ |