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.12 by tim, Thu Jul 31 16:43:47 2003 UTC vs.
Revision 1.15 by tim, Wed Aug 6 18:22:09 2003 UTC

# Line 523 | Line 523 | public class ConcurrentHashMap<K, V> ext
523  
524      /**
525       * Constructs a new, empty map with a default initial capacity,
526 <     * load factor, and number of segments
526 >     * load factor, and number of segments.
527       */
528      public ConcurrentHashMap() {
529          this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_SEGMENTS);
# Line 730 | Line 730 | public class ConcurrentHashMap<K, V> ext
730       * @throws  NullPointerException  if the key is
731       *               <code>null</code>.
732       */
733 <    public V remove(Object key, Object value) {
733 >    public boolean remove(Object key, Object value) {
734          int hash = hash(key);
735 <        return segmentFor(hash).remove(key, hash, value);
735 >        return segmentFor(hash).remove(key, hash, value) != null;
736      }
737  
738      /**
# Line 772 | Line 772 | public class ConcurrentHashMap<K, V> ext
772       * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt>, and
773       * <tt>clear</tt> operations.  It does not support the <tt>add</tt> or
774       * <tt>addAll</tt> operations.
775 +     * The returned <tt>iterator</tt> is a "weakly consistent" iterator that
776 +     * will never throw {@link java.util.ConcurrentModificationException},
777 +     * and guarantees to traverse elements as they existed upon
778 +     * construction of the iterator, and may (but is not guaranteed to)
779 +     * reflect any modifications subsequent to construction.
780       *
781       * @return a set view of the keys contained in this map.
782       */
# Line 789 | Line 794 | public class ConcurrentHashMap<K, V> ext
794       * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
795       * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.
796       * It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
797 +     * The returned <tt>iterator</tt> is a "weakly consistent" iterator that
798 +     * will never throw {@link java.util.ConcurrentModificationException},
799 +     * and guarantees to traverse elements as they existed upon
800 +     * construction of the iterator, and may (but is not guaranteed to)
801 +     * reflect any modifications subsequent to construction.
802       *
803       * @return a collection view of the values contained in this map.
804       */
# Line 807 | Line 817 | public class ConcurrentHashMap<K, V> ext
817       * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
818       * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.
819       * It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
820 +     * The returned <tt>iterator</tt> is a "weakly consistent" iterator that
821 +     * will never throw {@link java.util.ConcurrentModificationException},
822 +     * and guarantees to traverse elements as they existed upon
823 +     * construction of the iterator, and may (but is not guaranteed to)
824 +     * reflect any modifications subsequent to construction.
825       *
826       * @return a collection view of the mappings contained in this map.
827       */
# Line 964 | Line 979 | public class ConcurrentHashMap<K, V> ext
979              if (!(o instanceof Map.Entry))
980                  return false;
981              Map.Entry<K,V> e = (Map.Entry<K,V>)o;
982 <            return ConcurrentHashMap.this.remove(e.getKey(), e.getValue()) != null;
982 >            return ConcurrentHashMap.this.remove(e.getKey(), e.getValue());
983          }
984          public int size() {
985              return ConcurrentHashMap.this.size();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines