ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/ConcurrentHashMapV8.java
(Generate patch)

Comparing jsr166/src/jsr166e/ConcurrentHashMapV8.java (file contents):
Revision 1.90 by dl, Tue Jan 22 20:17:55 2013 UTC vs.
Revision 1.98 by jsr166, Mon Feb 11 20:52:00 2013 UTC

# Line 1977 | Line 1977 | public class ConcurrentHashMapV8<K, V>
1977          }
1978      }
1979  
1980 <    /*
1980 >    /**
1981       * Moves and/or copies the nodes in each bin to new table. See
1982       * above for explanation.
1983       */
# Line 2894 | Line 2894 | public class ConcurrentHashMapV8<K, V>
2894       * course only appropriate if it is acceptable to use the same
2895       * value for all additions from this view.
2896       *
2897 <     * @param mappedValue the mapped value to use for any
2898 <     * additions.
2897 >     * @param mappedValue the mapped value to use for any additions
2898       * @return the set view
2899       * @throws NullPointerException if the mappedValue is null
2900       */
# Line 3373 | Line 3372 | public class ConcurrentHashMapV8<K, V>
3372       * of each (key, value).
3373       *
3374       * @param transformer a function returning the transformation
3375 <     * for an element, or null of there is no transformation (in
3376 <     * which case the action is not applied).
3375 >     * for an element, or null if there is no transformation (in
3376 >     * which case the action is not applied)
3377       * @param action the action
3378       */
3379      @SuppressWarnings("unchecked") public <U> void forEachSequentially
# Line 3417 | Line 3416 | public class ConcurrentHashMapV8<K, V>
3416       * combine values, or null if none.
3417       *
3418       * @param transformer a function returning the transformation
3419 <     * for an element, or null of there is no transformation (in
3420 <     * which case it is not combined).
3419 >     * for an element, or null if there is no transformation (in
3420 >     * which case it is not combined)
3421       * @param reducer a commutative associative combining function
3422       * @return the result of accumulating the given transformation
3423       * of all (key, value) pairs
# Line 3530 | Line 3529 | public class ConcurrentHashMapV8<K, V>
3529       * of each key.
3530       *
3531       * @param transformer a function returning the transformation
3532 <     * for an element, or null of there is no transformation (in
3533 <     * which case the action is not applied).
3532 >     * for an element, or null if there is no transformation (in
3533 >     * which case the action is not applied)
3534       * @param action the action
3535       */
3536      @SuppressWarnings("unchecked") public <U> void forEachKeySequentially
# Line 3595 | Line 3594 | public class ConcurrentHashMapV8<K, V>
3594       * null if none.
3595       *
3596       * @param transformer a function returning the transformation
3597 <     * for an element, or null of there is no transformation (in
3598 <     * which case it is not combined).
3597 >     * for an element, or null if there is no transformation (in
3598 >     * which case it is not combined)
3599       * @param reducer a commutative associative combining function
3600       * @return the result of accumulating the given transformation
3601       * of all keys
# Line 3708 | Line 3707 | public class ConcurrentHashMapV8<K, V>
3707       * of each value.
3708       *
3709       * @param transformer a function returning the transformation
3710 <     * for an element, or null of there is no transformation (in
3711 <     * which case the action is not applied).
3710 >     * for an element, or null if there is no transformation (in
3711 >     * which case the action is not applied)
3712       */
3713      public <U> void forEachValueSequentially
3714          (Fun<? super V, ? extends U> transformer,
# Line 3768 | Line 3767 | public class ConcurrentHashMapV8<K, V>
3767       * null if none.
3768       *
3769       * @param transformer a function returning the transformation
3770 <     * for an element, or null of there is no transformation (in
3771 <     * which case it is not combined).
3770 >     * for an element, or null if there is no transformation (in
3771 >     * which case it is not combined)
3772       * @param reducer a commutative associative combining function
3773       * @return the result of accumulating the given transformation
3774       * of all values
# Line 3882 | Line 3881 | public class ConcurrentHashMapV8<K, V>
3881       * of each entry.
3882       *
3883       * @param transformer a function returning the transformation
3884 <     * for an element, or null of there is no transformation (in
3885 <     * which case the action is not applied).
3884 >     * for an element, or null if there is no transformation (in
3885 >     * which case the action is not applied)
3886       * @param action the action
3887       */
3888      @SuppressWarnings("unchecked") public <U> void forEachEntrySequentially
# Line 3945 | Line 3944 | public class ConcurrentHashMapV8<K, V>
3944       * or null if none.
3945       *
3946       * @param transformer a function returning the transformation
3947 <     * for an element, or null of there is no transformation (in
3948 <     * which case it is not combined).
3947 >     * for an element, or null if there is no transformation (in
3948 >     * which case it is not combined)
3949       * @param reducer a commutative associative combining function
3950       * @return the result of accumulating the given transformation
3951       * of all entries
# Line 4057 | Line 4056 | public class ConcurrentHashMapV8<K, V>
4056       * of each (key, value).
4057       *
4058       * @param transformer a function returning the transformation
4059 <     * for an element, or null of there is no transformation (in
4060 <     * which case the action is not applied).
4059 >     * for an element, or null if there is no transformation (in
4060 >     * which case the action is not applied)
4061       * @param action the action
4062       */
4063      public <U> void forEachInParallel
# Line 4092 | Line 4091 | public class ConcurrentHashMapV8<K, V>
4091       * combine values, or null if none.
4092       *
4093       * @param transformer a function returning the transformation
4094 <     * for an element, or null of there is no transformation (in
4095 <     * which case it is not combined).
4094 >     * for an element, or null if there is no transformation (in
4095 >     * which case it is not combined)
4096       * @param reducer a commutative associative combining function
4097       * @return the result of accumulating the given transformation
4098       * of all (key, value) pairs
# Line 4180 | Line 4179 | public class ConcurrentHashMapV8<K, V>
4179       * of each key.
4180       *
4181       * @param transformer a function returning the transformation
4182 <     * for an element, or null of there is no transformation (in
4183 <     * which case the action is not applied).
4182 >     * for an element, or null if there is no transformation (in
4183 >     * which case the action is not applied)
4184       * @param action the action
4185       */
4186      public <U> void forEachKeyInParallel
# Line 4229 | Line 4228 | public class ConcurrentHashMapV8<K, V>
4228       * null if none.
4229       *
4230       * @param transformer a function returning the transformation
4231 <     * for an element, or null of there is no transformation (in
4232 <     * which case it is not combined).
4231 >     * for an element, or null if there is no transformation (in
4232 >     * which case it is not combined)
4233       * @param reducer a commutative associative combining function
4234       * @return the result of accumulating the given transformation
4235       * of all keys
# Line 4317 | Line 4316 | public class ConcurrentHashMapV8<K, V>
4316       * of each value.
4317       *
4318       * @param transformer a function returning the transformation
4319 <     * for an element, or null of there is no transformation (in
4320 <     * which case the action is not applied).
4319 >     * for an element, or null if there is no transformation (in
4320 >     * which case the action is not applied)
4321       */
4322      public <U> void forEachValueInParallel
4323          (Fun<? super V, ? extends U> transformer,
# Line 4364 | Line 4363 | public class ConcurrentHashMapV8<K, V>
4363       * null if none.
4364       *
4365       * @param transformer a function returning the transformation
4366 <     * for an element, or null of there is no transformation (in
4367 <     * which case it is not combined).
4366 >     * for an element, or null if there is no transformation (in
4367 >     * which case it is not combined)
4368       * @param reducer a commutative associative combining function
4369       * @return the result of accumulating the given transformation
4370       * of all values
# Line 4452 | Line 4451 | public class ConcurrentHashMapV8<K, V>
4451       * of each entry.
4452       *
4453       * @param transformer a function returning the transformation
4454 <     * for an element, or null of there is no transformation (in
4455 <     * which case the action is not applied).
4454 >     * for an element, or null if there is no transformation (in
4455 >     * which case the action is not applied)
4456       * @param action the action
4457       */
4458      public <U> void forEachEntryInParallel
# Line 4500 | Line 4499 | public class ConcurrentHashMapV8<K, V>
4499       * or null if none.
4500       *
4501       * @param transformer a function returning the transformation
4502 <     * for an element, or null of there is no transformation (in
4503 <     * which case it is not combined).
4502 >     * for an element, or null if there is no transformation (in
4503 >     * which case it is not combined)
4504       * @param reducer a commutative associative combining function
4505       * @return the result of accumulating the given transformation
4506       * of all entries
# Line 4716 | Line 4715 | public class ConcurrentHashMapV8<K, V>
4715       * A view of a ConcurrentHashMapV8 as a {@link Set} of keys, in
4716       * which additions may optionally be enabled by mapping to a
4717       * common value.  This class cannot be directly instantiated. See
4718 <     * {@link #keySet}, {@link #keySet(Object)}, {@link #newKeySet()},
4718 >     * {@link #keySet()}, {@link #keySet(Object)}, {@link #newKeySet()},
4719       * {@link #newKeySet(int)}.
4720       */
4721      public static class KeySetView<K,V> extends CHMView<K,V>
# Line 4733 | Line 4732 | public class ConcurrentHashMapV8<K, V>
4732           * or {@code null} if additions are not supported.
4733           *
4734           * @return the default mapped value for additions, or {@code null}
4735 <         * if not supported.
4735 >         * if not supported
4736           */
4737          public V getMappedValue() { return value; }
4738  
# Line 4757 | Line 4756 | public class ConcurrentHashMapV8<K, V>
4756              V v;
4757              if ((v = value) == null)
4758                  throw new UnsupportedOperationException();
4760            if (e == null)
4761                throw new NullPointerException();
4759              return map.internalPut(e, v, true) == null;
4760          }
4761          public boolean addAll(Collection<? extends K> c) {
# Line 4767 | Line 4764 | public class ConcurrentHashMapV8<K, V>
4764              if ((v = value) == null)
4765                  throw new UnsupportedOperationException();
4766              for (K e : c) {
4770                if (e == null)
4771                    throw new NullPointerException();
4767                  if (map.internalPut(e, v, true) == null)
4768                      added = true;
4769              }
# Line 4785 | Line 4780 | public class ConcurrentHashMapV8<K, V>
4780      /**
4781       * A view of a ConcurrentHashMapV8 as a {@link Collection} of
4782       * values, in which additions are disabled. This class cannot be
4783 <     * directly instantiated. See {@link #values},
4783 >     * directly instantiated. See {@link #values()}.
4784       *
4785       * <p>The view's {@code iterator} is a "weakly consistent" iterator
4786       * that will never throw {@link ConcurrentModificationException},
# Line 4835 | Line 4830 | public class ConcurrentHashMapV8<K, V>
4830      /**
4831       * A view of a ConcurrentHashMapV8 as a {@link Set} of (key, value)
4832       * entries.  This class cannot be directly instantiated. See
4833 <     * {@link #entrySet}.
4833 >     * {@link #entrySet()}.
4834       */
4835      public static final class EntrySetView<K,V> extends CHMView<K,V>
4836          implements Set<Map.Entry<K,V>> {
# Line 4871 | Line 4866 | public class ConcurrentHashMapV8<K, V>
4866          }
4867  
4868          public final boolean add(Entry<K,V> e) {
4869 <            K key = e.getKey();
4875 <            V value = e.getValue();
4876 <            if (key == null || value == null)
4877 <                throw new NullPointerException();
4878 <            return map.internalPut(key, value, false) == null;
4869 >            return map.internalPut(e.getKey(), e.getValue(), false) == null;
4870          }
4871          public final boolean addAll(Collection<? extends Entry<K,V>> c) {
4872              boolean added = false;
# Line 4972 | Line 4963 | public class ConcurrentHashMapV8<K, V>
4963           * @param map the map
4964           * @param transformer a function returning the transformation
4965           * for an element, or null if there is no transformation (in
4966 <         * which case it is not combined).
4966 >         * which case it is not combined)
4967           * @param reducer a commutative associative combining function
4968           * @return the task
4969           */
# Line 5139 | Line 5130 | public class ConcurrentHashMapV8<K, V>
5130           * @param map the map
5131           * @param transformer a function returning the transformation
5132           * for an element, or null if there is no transformation (in
5133 <         * which case it is not combined).
5133 >         * which case it is not combined)
5134           * @param reducer a commutative associative combining function
5135           * @return the task
5136           */
# Line 5305 | Line 5296 | public class ConcurrentHashMapV8<K, V>
5296           * @param map the map
5297           * @param transformer a function returning the transformation
5298           * for an element, or null if there is no transformation (in
5299 <         * which case it is not combined).
5299 >         * which case it is not combined)
5300           * @param reducer a commutative associative combining function
5301           * @return the task
5302           */
# Line 5471 | Line 5462 | public class ConcurrentHashMapV8<K, V>
5462           * @param map the map
5463           * @param transformer a function returning the transformation
5464           * for an element, or null if there is no transformation (in
5465 <         * which case it is not combined).
5465 >         * which case it is not combined)
5466           * @param reducer a commutative associative combining function
5467           * @return the task
5468           */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines