From 3831381763ca5f41d6f7406d590e1e38a8531e1c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 18 Jun 2002 15:40:16 +0000 Subject: javaprims.h: Updated class declaration list. * gcj/javaprims.h: Updated class declaration list. * Makefile.in: Rebuilt. * Makefile.am (core_java_source_files): Added PropertyPermissionCollection.java. * java/lang/Thread.java (group, name): Now package-private. * java/lang/ThreadGroup.java: Re-merge with Classpath. * java/util/AbstractList.java: Likewise. * java/util/AbstractMap.java: Likewise. * java/util/Calendar.java: Likewise. * java/util/Collections.java: Likewise. * java/util/HashMap.java: Likewise. * java/util/Hashtable.java: Likewise. * java/util/LinkedHashMap.java: Likewise. * java/util/LinkedList.java: Likewise. * java/util/List.java: Likewise. * java/util/ListResourceBundle.java: Likewise. * java/util/Map.java: Likewise. * java/util/Observable.java: Likewise. * java/util/Properties.java: Likewise. * java/util/PropertyPermission.java: Likewise. * java/util/PropertyPermissionCollection.java: Likewise. * java/util/PropertyResourceBundle.java: Likewise. * java/util/Random.java: Likewise. * java/util/SimpleTimeZone.java: Likewise. * java/util/StringTokenizer.java: Likewise. * java/util/TimerTask.java: Likewise. * java/util/TreeMap.java: Likewise. * java/util/WeakHashMap.java: Likewise. * java/util/jar/Attributes.java: Likewise. * java/util/jar/JarException.java: Likewise. * java/util/jar/Manifest.java: Likewise. From-SVN: r54743 --- libjava/java/util/LinkedHashMap.java | 39 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'libjava/java/util/LinkedHashMap.java') diff --git a/libjava/java/util/LinkedHashMap.java b/libjava/java/util/LinkedHashMap.java index 0709bdf..2716ac1 100644 --- a/libjava/java/util/LinkedHashMap.java +++ b/libjava/java/util/LinkedHashMap.java @@ -71,7 +71,7 @@ package java.util; *

* * Under ideal circumstances (no collisions), LinkedHashMap offers O(1) - * performance on most operations (

containsValue()
is, + * performance on most operations (containsValue() is, * of course, O(n)). In the worst case (all keys map to the same * hash code -- very unlikely), most operations are O(n). *

@@ -87,7 +87,7 @@ package java.util; * {@link ConcurrentModificationException} rather than exhibit * non-deterministic behavior. * - * @author Eric Blake + * @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

o
, such that - *
o.equals(value)
. + * Returns true if this HashMap contains a value + * o, such that o.equals(value). * * @param value the value to search for in this HashMap - * @return true if at least one key maps to the value + * + * @return true 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
null
if the key maps to nothing. If this is an + * or null 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 *

* * For example, to keep the Map limited to 100 entries, override as follows: - *

-   * private static final int MAX_ENTRIES = 100;
-   *
-   * protected boolean removeEldestEntry(Map.Entry eldest)
-   * {
-   *   return size() > MAX_ENTRIES;
-   * }
-   * 

+ * +

private static final int MAX_ENTRIES = 100;
+
+protected boolean removeEldestEntry(Map.Entry eldest)
+{
+  return size() > MAX_ENTRIES;
+}
+

* * Typically, this method does not modify the map, but just uses the * return value as an indication to put 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 eldest 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

next()
method. + * with the next() method. + * * @throws ConcurrentModificationException if the HashMap was modified + * * @throws IllegalStateException if called when there is no last element */ public void remove() -- cgit v1.1