ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.5 by dl, Fri Jun 6 18:42:17 2003 UTC vs.
Revision 1.6 by dl, Mon Jun 9 02:32:05 2003 UTC

# Line 105 | Line 105 | public class ConcurrentHashMap<K, V> ext
105       */
106      private final Segment<K,V>[] segments;
107  
108 <    private transient Set<K> keySet = null;
109 <    private transient Set/*<Map.Entry<K,V>>*/ entrySet = null;
110 <    private transient Collection<V> values = null;
108 >    private transient Set<K> keySet;
109 >    private transient Set/*<Map.Entry<K,V>>*/ entrySet;
110 >    private transient Collection<V> values;
111  
112      /* ---------------- Small Utilities -------------- */
113  
# Line 155 | Line 155 | public class ConcurrentHashMap<K, V> ext
155      /* ---------------- Inner Classes -------------- */
156  
157      /**
158 <     * Segments are specialized versions of hash tables.  This
158 >     * Segments are specialized versions of hash tables.  This
159       * subclasses from ReentrantLock opportunistically, just to
160       * simplify some locking and avoid separate construction.
161       **/
# Line 374 | Line 374 | public class ConcurrentHashMap<K, V> ext
374              }
375              setTable(newTable);
376          }
377 <        
377 >
378 >        /**
379 >         * Remove; match on key only if value null, else match both.
380 >         */
381          V remove(Object key, int hash, Object value) {
382              lock();
383              try {
# Line 730 | Line 733 | public class ConcurrentHashMap<K, V> ext
733      /**
734       * Removes the (key, value) pair from this
735       * table. This method does nothing if the key is not in the table,
736 <     * or if the key is associated with a different value. This method
734 <     * is needed by EntrySet.
736 >     * or if the key is associated with a different value.
737       *
738       * @param   key   the key that needs to be removed.
739       * @param   value   the associated value. If the value is null,
# Line 742 | Line 744 | public class ConcurrentHashMap<K, V> ext
744       *               <code>null</code>.
745       */
746      public V remove(Object key, Object value) {
745        if (value == null)
746            return null;
747          int hash = hash(key);
748          return segmentFor(hash).remove(key, segmentHashFor(hash), value);
749      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines