diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-04 05:34:47 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-04 05:34:47 +0000 |
commit | dea7a92deca8a9a779825128d13e6303014c4731 (patch) | |
tree | 52a097293728b3e19e2c51a3382a5984edd0a0d6 /libjava/java/util/Collections.java | |
parent | 1145b69853cc44b1463a9d0ce781677238f19386 (diff) | |
download | ppe42-gcc-dea7a92deca8a9a779825128d13e6303014c4731.tar.gz ppe42-gcc-dea7a92deca8a9a779825128d13e6303014c4731.zip |
* java/io/SequenceInputStream.java: Merge with Classpath
* java/io/StringBufferInputStream.java: Ditto
* java/util/Collections.java: Remerge with Classpath
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46005 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/Collections.java')
-rw-r--r-- | libjava/java/util/Collections.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libjava/java/util/Collections.java b/libjava/java/util/Collections.java index 74efdec65bf..3e2a40e554c 100644 --- a/libjava/java/util/Collections.java +++ b/libjava/java/util/Collections.java @@ -1,5 +1,5 @@ /* Collections.java -- Utility class with methods to operate on collections - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -595,7 +595,7 @@ public class Collections * of this method is Serializable. * * @param o the single element. - * @returns an immutable Set containing only o. + * @return an immutable Set containing only o. */ // It's not serializable because the spec is broken. public static Set singleton(final Object o) @@ -645,7 +645,7 @@ public class Collections * of this method is Serializable. * * @param o the single element. - * @returns an immutable List containing only o. + * @return an immutable List containing only o. */ // It's not serializable because the spec is broken. public static List singletonList(final Object o) @@ -677,7 +677,7 @@ public class Collections * * @param key the single key. * @param value the single value. - * @returns an immutable Map containing only the single key value pair. + * @return an immutable Map containing only the single key value pair. */ // It's not serializable because the spec is broken. public static Map singletonMap(final Object key, final Object value) @@ -686,7 +686,7 @@ public class Collections { public Set entrySet() { - return singleton(new HashMap.Entry(key, value)); + return singleton(new BasicMapEntry(key, value)); } }; } @@ -1294,7 +1294,11 @@ public class Collections } } - private static class SynchronizedCollection implements Collection, + /** + * Package visible, so that collections such as the one for + * Hashtable.values() can specify which object to synchronize on. + */ + static class SynchronizedCollection implements Collection, Serializable { Object sync; @@ -1522,7 +1526,11 @@ public class Collections } } - private static class SynchronizedSet extends SynchronizedCollection + /** + * Package visible, so that sets such as the one for Hashtable.keySet() + * can specify which object to synchronize on. + */ + static class SynchronizedSet extends SynchronizedCollection implements Set { public SynchronizedSet(Object sync, Set s) |