ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.48 by dl, Wed Jun 2 23:49:06 2004 UTC vs.
Revision 1.49 by dl, Tue Jun 22 22:36:20 2004 UTC

# Line 1225 | Line 1225 | public class ConcurrentHashMap<K, V> ext
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> {
# Line 1240 | Line 1252 | public class ConcurrentHashMap<K, V> ext
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>> {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines