diff options
author | Sascha Brawer <brawer@dandelis.ch> | 2002-04-30 14:05:06 +0000 |
---|---|---|
committer | Sascha Brawer <brawer@dandelis.ch> | 2002-04-30 14:05:06 +0000 |
commit | c4e3f58c6e6490687f2ec06c57b23777e5153f15 (patch) | |
tree | 8ec1714749c996ea7d6a8a2aa088629f1b3ab9af | |
parent | a75fa423ba826bf33adbb0a80432c7d7feab03ef (diff) | |
download | classpath-c4e3f58c6e6490687f2ec06c57b23777e5153f15.tar.gz |
LinkedHashMap(int), removeEldestEntry(Map.Entry), class description:
Docfix to avoid angle brackets in Javadoc and for pre-formatted
code without asterisks.
-rw-r--r-- | java/util/LinkedHashMap.java | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/java/util/LinkedHashMap.java b/java/util/LinkedHashMap.java index 0709bdf5e..2716ac100 100644 --- a/java/util/LinkedHashMap.java +++ b/java/util/LinkedHashMap.java @@ -71,7 +71,7 @@ package java.util; * <p> * * Under ideal circumstances (no collisions), LinkedHashMap offers O(1) - * performance on most operations (<pre>containsValue()</pre> is, + * performance on most operations (<code>containsValue()</code> is, * of course, O(n)). In the worst case (all keys map to the same * hash code -- very unlikely), most operations are O(n). * <p> @@ -87,7 +87,7 @@ package java.util; * {@link ConcurrentModificationException} rather than exhibit * non-deterministic behavior. * - * @author Eric Blake <ebb9@email.byu.edu> + * @author Eric Blake (ebb9@email.byu.edu) * @see Object#hashCode() * @see Collection * @see Map @@ -256,8 +256,9 @@ public class LinkedHashMap extends HashMap * @param initialCapacity the initial capacity (>=0) * @param loadFactor the load factor (>0, not NaN) * @param accessOrder true for access-order, false for insertion-order - * @throws IllegalArgumentException if (initialCapacity < 0) || - * ! (loadFactor > 0.0) + * + * @throws IllegalArgumentException if (initialCapacity < 0) || + * ! (loadFactor > 0.0) */ public LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder) @@ -277,11 +278,12 @@ public class LinkedHashMap extends HashMap } /** - * Returns true if this HashMap contains a value <pre>o</pre>, such that - * <pre>o.equals(value)</pre>. + * Returns <code>true</code> if this HashMap contains a value + * <code>o</code>, such that <code>o.equals(value)</code>. * * @param value the value to search for in this HashMap - * @return true if at least one key maps to the value + * + * @return <code>true</code> if at least one key maps to the value */ public boolean containsValue(Object value) { @@ -297,7 +299,7 @@ public class LinkedHashMap extends HashMap /** * Return the value in this Map associated with the supplied key, - * or <pre>null</pre> if the key maps to nothing. If this is an + * or <code>null</code> if the key maps to nothing. If this is an * access-ordered Map and the key is found, this performs structural * modification, moving the key to the newest end of the list. NOTE: * Since the value could also be null, you must use containsKey to @@ -350,14 +352,14 @@ public class LinkedHashMap extends HashMap * <p> * * For example, to keep the Map limited to 100 entries, override as follows: - * <pre> - * private static final int MAX_ENTRIES = 100; - * - * protected boolean removeEldestEntry(Map.Entry eldest) - * { - * return size() > MAX_ENTRIES; - * } - * </pre><p> + * +<pre>private static final int MAX_ENTRIES = 100; + +protected boolean removeEldestEntry(Map.Entry eldest) +{ + return size() > MAX_ENTRIES; +} +</pre><p> * * Typically, this method does not modify the map, but just uses the * return value as an indication to <code>put</code> whether to proceed. @@ -376,6 +378,7 @@ public class LinkedHashMap extends HashMap * returns true. For an access-order map, this is the least * recently accessed; for an insertion-order map, this is the * earliest element inserted. + * * @return true if <code>eldest</code> should be removed */ protected boolean removeEldestEntry(Map.Entry eldest) @@ -467,8 +470,10 @@ public class LinkedHashMap extends HashMap /** * Removes from the backing HashMap the last element which was fetched - * with the <pre>next()</pre> method. + * with the <code>next()</code> method. + * * @throws ConcurrentModificationException if the HashMap was modified + * * @throws IllegalStateException if called when there is no last element */ public void remove() |