harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r546204 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashMap.java
Date Mon, 11 Jun 2007 17:11:28 GMT
Author: tellison
Date: Mon Jun 11 10:11:27 2007
New Revision: 546204

URL: http://svn.apache.org/viewvc?view=rev&rev=546204
Log:
Apply slightly modified patch for HARMONY-4082 ([classlib][luni] Performance improvement of
java.util.LinkedHashMap)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashMap.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashMap.java?view=diff&rev=546204&r1=546203&r2=546204
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashMap.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashMap.java
Mon Jun 11 10:11:27 2007
@@ -221,6 +221,35 @@
             return entry;
         }
     }
+    
+    /**
+     * Searches this map for the specified value.
+     * 
+     * @param value
+     *            the object to search for
+     * @return true if <code>value</code> is a value of this HashMap, false
+     *         otherwise
+     */
+    @Override
+    public boolean containsValue(Object value) {
+        LinkedHashMapEntry<K, V> entry = head;
+        if (null == value) {
+            while (null != entry) {
+                if (null == entry.value) {
+                    return true;
+                }
+                entry = entry.chainForward;
+            }
+        } else {
+            while (null != entry) {
+                if (value.equals(entry.value)) {
+                    return true;
+                }
+                entry = entry.chainForward;
+            }
+        }
+        return false;
+    }
 
     /**
      * Create a new element array



Mime
View raw message