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.63 by dl, Sat Sep 29 16:01:22 2012 UTC vs.
Revision 1.67 by jsr166, Sun Oct 21 04:07:13 2012 UTC

# Line 2506 | Line 2506 | public class ConcurrentHashMapV8<K, V>
2506  
2507      /**
2508       * Returns the value to which the specified key is mapped,
2509 <     * or the gieven defaultValue if this map contains no mapping for the key.
2509 >     * or the given defaultValue if this map contains no mapping for the key.
2510       *
2511       * @param key the key
2512       * @param defaultValue the value to return if this map contains
2513 <     * no mapping for the given key.
2513 >     * no mapping for the given key
2514       * @return the mapping for the key, if present; else the defaultValue
2515       * @throws NullPointerException if the specified key is null
2516       */
# Line 2650 | Line 2650 | public class ConcurrentHashMapV8<K, V>
2650       * @param key key with which the specified value is to be associated
2651       * @param mappingFunction the function to compute a value
2652       * @return the current (existing or computed) value associated with
2653 <     *         the specified key, or null if the computed value is null.
2653 >     *         the specified key, or null if the computed value is null
2654       * @throws NullPointerException if the specified key or mappingFunction
2655       *         is null
2656       * @throws IllegalStateException if the computation detectably
# Line 3672 | Line 3672 | public class ConcurrentHashMapV8<K, V>
3672           *
3673           * @param transformer a function returning the transformation
3674           * for an element, or null of there is no transformation (in
3675 <         * which case the action is not applied).
3675 >         * which case the action is not applied)
3676           * @param action the action
3677           */
3678          public <U> void forEach(BiFun<? super K, ? super V, ? extends U> transformer,
# Line 3705 | Line 3705 | public class ConcurrentHashMapV8<K, V>
3705           *
3706           * @param transformer a function returning the transformation
3707           * for an element, or null of there is no transformation (in
3708 <         * which case it is not combined).
3708 >         * which case it is not combined)
3709           * @param reducer a commutative associative combining function
3710           * @return the result of accumulating the given transformation
3711           * of all (key, value) pairs
# Line 3789 | Line 3789 | public class ConcurrentHashMapV8<K, V>
3789           *
3790           * @param transformer a function returning the transformation
3791           * for an element, or null of there is no transformation (in
3792 <         * which case the action is not applied).
3792 >         * which case the action is not applied)
3793           * @param action the action
3794           */
3795          public <U> void forEachKey(Fun<? super K, ? extends U> transformer,
# Line 3835 | Line 3835 | public class ConcurrentHashMapV8<K, V>
3835           *
3836           * @param transformer a function returning the transformation
3837           * for an element, or null of there is no transformation (in
3838 <         * which case it is not combined).
3838 >         * which case it is not combined)
3839           * @param reducer a commutative associative combining function
3840           * @return the result of accumulating the given transformation
3841           * of all keys
# Line 3919 | Line 3919 | public class ConcurrentHashMapV8<K, V>
3919           *
3920           * @param transformer a function returning the transformation
3921           * for an element, or null of there is no transformation (in
3922 <         * which case the action is not applied).
3922 >         * which case the action is not applied)
3923           */
3924          public <U> void forEachValue(Fun<? super V, ? extends U> transformer,
3925                                       Action<U> action) {
# Line 3964 | Line 3964 | public class ConcurrentHashMapV8<K, V>
3964           *
3965           * @param transformer a function returning the transformation
3966           * for an element, or null of there is no transformation (in
3967 <         * which case it is not combined).
3967 >         * which case it is not combined)
3968           * @param reducer a commutative associative combining function
3969           * @return the result of accumulating the given transformation
3970           * of all values
# Line 4048 | Line 4048 | public class ConcurrentHashMapV8<K, V>
4048           *
4049           * @param transformer a function returning the transformation
4050           * for an element, or null of there is no transformation (in
4051 <         * which case the action is not applied).
4051 >         * which case the action is not applied)
4052           * @param action the action
4053           */
4054          public <U> void forEachEntry(Fun<Map.Entry<K,V>, ? extends U> transformer,
# Line 4197 | Line 4197 | public class ConcurrentHashMapV8<K, V>
4197           * @param map the map
4198           * @param transformer a function returning the transformation
4199           * for an element, or null of there is no transformation (in
4200 <         * which case the action is not applied).
4200 >         * which case the action is not applied)
4201           * @param action the action
4202           * @return the task
4203           */
# Line 4347 | Line 4347 | public class ConcurrentHashMapV8<K, V>
4347           * @param map the map
4348           * @param transformer a function returning the transformation
4349           * for an element, or null of there is no transformation (in
4350 <         * which case the action is not applied).
4350 >         * which case the action is not applied)
4351           * @param action the action
4352           * @return the task
4353           */
# Line 4514 | Line 4514 | public class ConcurrentHashMapV8<K, V>
4514           * @param map the map
4515           * @param transformer a function returning the transformation
4516           * for an element, or null of there is no transformation (in
4517 <         * which case the action is not applied).
4517 >         * which case the action is not applied)
4518           * @param action the action
4519           */
4520          public static <K,V,U> ForkJoinTask<Void> forEachValue
# Line 4681 | Line 4681 | public class ConcurrentHashMapV8<K, V>
4681           * @param map the map
4682           * @param transformer a function returning the transformation
4683           * for an element, or null of there is no transformation (in
4684 <         * which case the action is not applied).
4684 >         * which case the action is not applied)
4685           * @param action the action
4686           */
4687          public static <K,V,U> ForkJoinTask<Void> forEachEntry
# Line 4846 | Line 4846 | public class ConcurrentHashMapV8<K, V>
4846          int batch;                     // split control; -1 for unknown
4847          int pending;                   // completion control
4848  
4849 <        BulkTask(ConcurrentHashMapV8<K,V> map, BulkTask<K,V,?> parent,
4849 >        BulkTask(ConcurrentHashMapV8<K,V> map, BulkTask<K,V,?> parent,
4850                   int batch) {
4851              super(map);
4852              this.parent = parent;
# Line 5439 | Line 5439 | public class ConcurrentHashMapV8<K, V>
5439                      if ((c = t.pending) == 0) {
5440                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5441                              if ((sr = s.result) != null)
5442 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5442 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5443                          }
5444                          if ((par = t.parent) == null ||
5445                              !(par instanceof ReduceKeysTask)) {
# Line 5494 | Line 5494 | public class ConcurrentHashMapV8<K, V>
5494                      if ((c = t.pending) == 0) {
5495                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5496                              if ((sr = s.result) != null)
5497 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5497 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5498                          }
5499                          if ((par = t.parent) == null ||
5500                              !(par instanceof ReduceValuesTask)) {
# Line 5549 | Line 5549 | public class ConcurrentHashMapV8<K, V>
5549                      if ((c = t.pending) == 0) {
5550                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5551                              if ((sr = s.result) != null)
5552 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5552 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5553                          }
5554                          if ((par = t.parent) == null ||
5555                              !(par instanceof ReduceEntriesTask)) {
# Line 5608 | Line 5608 | public class ConcurrentHashMapV8<K, V>
5608                      if ((c = t.pending) == 0) {
5609                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5610                              if ((sr = s.result) != null)
5611 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5611 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5612                          }
5613                          if ((par = t.parent) == null ||
5614                              !(par instanceof MapReduceKeysTask)) {
# Line 5668 | Line 5668 | public class ConcurrentHashMapV8<K, V>
5668                      if ((c = t.pending) == 0) {
5669                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5670                              if ((sr = s.result) != null)
5671 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5671 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5672                          }
5673                          if ((par = t.parent) == null ||
5674                              !(par instanceof MapReduceValuesTask)) {
# Line 5728 | Line 5728 | public class ConcurrentHashMapV8<K, V>
5728                      if ((c = t.pending) == 0) {
5729                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5730                              if ((sr = s.result) != null)
5731 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5731 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5732                          }
5733                          if ((par = t.parent) == null ||
5734                              !(par instanceof MapReduceEntriesTask)) {
# Line 5788 | Line 5788 | public class ConcurrentHashMapV8<K, V>
5788                      if ((c = t.pending) == 0) {
5789                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5790                              if ((sr = s.result) != null)
5791 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5791 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5792                          }
5793                          if ((par = t.parent) == null ||
5794                              !(par instanceof MapReduceMappingsTask)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines