diff options
author | Eric Blake <ebb9@byu.net> | 2002-03-09 04:01:11 +0000 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2002-03-09 04:01:11 +0000 |
commit | c53f7f1c8c571f01006931934930f1780ec73fae (patch) | |
tree | e3573d77078b77eecb3bc6303968e286139de7e4 /java/util/WeakHashMap.java | |
parent | 02bb55dbba545d55c95b69ac6bf249180745df16 (diff) | |
download | classpath-c53f7f1c8c571f01006931934930f1780ec73fae.tar.gz |
2002-03-08 Eric Blake <ebb9@email.byu.edu>
* java/util/regex/Pattern.java (split): Add missing stubs.
* java/util/regex/Matcher.java (replace*): Ditto.
* doc/unicode/SpecialCasing-2.txt: New file from unicode.org.
* scripts/unicode-muncher.pl: Add special casing rules for
multi-character uppercase expansions.
* gnu/java/lang/CharData.java: Regenerate.
* java/util/WeakHashMap.java: Improve Javadoc.
* java/lang/CharSequence.java: Ditto.
* java/lang/Character.java (getDirectionality): Update to new
CharData format.
(direction, readChar): Change visibility.
(toString): One less method call.
* java/lang/String.java: General code cleanup, optimizations, and
better exception matching to Sun's implementation.
(internTable, intern): Switch to use weak references.
(String(StringBuffer), String(char[], int)): Implement array
sharing when the array comes from a trusted source.
(matches, replace*, split): New methods, that call unimplemented
stubs in java.util.regex.
(toUpperCase, toLowerCase): Correctly implement one-to-many case
conversions, and special casing based on locale.
(upperExpand, upperSpecial, upperCaseExpansion, upperCaseIndex):
New tables and methods, to implement toUpperCase.
* java/lang/StringBuffer.java: General code cleanup,
optimizations, and better exception matching.
(substring): Use array sharing.
(append(StringBuffer), indexOf, lastIndexOf): Avoid object
creation.
(regionMatches): New method, used by indexOf.
Diffstat (limited to 'java/util/WeakHashMap.java')
-rw-r--r-- | java/util/WeakHashMap.java | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/java/util/WeakHashMap.java b/java/util/WeakHashMap.java index 8c55ae0a5..06d1ff3f5 100644 --- a/java/util/WeakHashMap.java +++ b/java/util/WeakHashMap.java @@ -43,34 +43,33 @@ import java.lang.ref.WeakReference; import java.lang.ref.ReferenceQueue; /** - * A weak hash map has only weak references to the key. This means - * that it allows the key to be garbage collected if they are not used - * otherwise. If this happens, the weak hash map will eventually - * remove the whole entry from this map. <br> + * A weak hash map has only weak references to the key. This means that it + * allows the key to be garbage collected if it is not used otherwise. If + * this happens, the entry will eventually disappear from the map, + * asynchronously. * - * A weak hash map makes most sense, if the keys doesn't override the - * <code>equals</code>-method: If there is no other reference to the + * <p>A weak hash map makes most sense when the keys doesn't override the + * <code>equals</code> method: If there is no other reference to the * key nobody can ever look up the key in this table and so the entry - * can be removed. This table also works, if the <code>equals</code> - * method is overloaded, e.g. with Strings as keys, but you should be - * prepared that some entries disappear spontaneously. <br> + * can be removed. This table also works when the <code>equals</code> + * method is overloaded, such as String keys, but you should be prepared + * to deal with some entries disappearing spontaneously. * - * You should also be prepared that this hash map behaves very - * strange: The size of this map may spontaneously shrink (even if you - * use a synchronized map and synchronize it); it behaves as if - * another thread removes entries from this table without - * synchronizations. The entry set returned by <code>entrySet</code> + * <p>Other strange behaviors to be aware of: The size of this map may + * spontaneously shrink (even if you use a synchronized map and synchronize + * it); it behaves as if another thread removes entries from this table + * without synchronization. The entry set returned by <code>entrySet</code> * has similar phenomenons: The size may spontaneously shrink, or an - * entry, that was in the set before, suddenly disappears. <br> + * entry, that was in the set before, suddenly disappears. * - * A weak hash map is not meant for caches; use a normal map, with - * soft references as values instead, or try {@link LinkedHashMap}. <br> + * <p>A weak hash map is not meant for caches; use a normal map, with + * soft references as values instead, or try {@link LinkedHashMap}. * - * The weak hash map supports null values and null keys. The null key - * is never deleted from the map (except explictly of course). - * The performance of the methods are similar to that of a hash map. <br> + * <p>The weak hash map supports null values and null keys. The null key + * is never deleted from the map (except explictly of course). The + * performance of the methods are similar to that of a hash map. * - * The value objects are strongly referenced by this table. So if a + * <p>The value objects are strongly referenced by this table. So if a * value object maintains a strong reference to the key (either direct * or indirect) the key will never be removed from this map. According * to Sun, this problem may be fixed in a future release. It is not |