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 |
|
*/ |
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 |
3671 |
|
* of each (key, value). |
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). |
3674 |
> |
* for an element, or null if there is no transformation (in |
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, |
3704 |
|
* combine values, or null if none. |
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). |
3707 |
> |
* for an element, or null if there is no transformation (in |
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 |
3788 |
|
* of each key. |
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). |
3791 |
> |
* for an element, or null if there is no transformation (in |
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, |
3834 |
|
* null if none. |
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). |
3837 |
> |
* for an element, or null if there is no transformation (in |
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 |
3918 |
|
* of each value. |
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). |
3921 |
> |
* for an element, or null if there is no transformation (in |
3922 |
> |
* which case the action is not applied) |
3923 |
|
*/ |
3924 |
|
public <U> void forEachValue(Fun<? super V, ? extends U> transformer, |
3925 |
|
Action<U> action) { |
3938 |
|
* result on success, else null |
3939 |
|
* @return a non-null result from applying the given search |
3940 |
|
* function on each value, or null if none |
3941 |
– |
* |
3941 |
|
*/ |
3942 |
|
public <U> U searchValues(Fun<? super V, ? extends U> searchFunction) { |
3943 |
|
return fjp.invoke(ForkJoinTasks.searchValues |
3962 |
|
* null if none. |
3963 |
|
* |
3964 |
|
* @param transformer a function returning the transformation |
3965 |
< |
* for an element, or null of there is no transformation (in |
3966 |
< |
* which case it is not combined). |
3965 |
> |
* for an element, or null if there is no transformation (in |
3966 |
> |
* which case it is not combined) |
3967 |
|
* @param reducer a commutative associative combining function |
3968 |
|
* @return the result of accumulating the given transformation |
3969 |
|
* of all values |
4046 |
|
* of each entry. |
4047 |
|
* |
4048 |
|
* @param transformer a function returning the transformation |
4049 |
< |
* for an element, or null of there is no transformation (in |
4050 |
< |
* which case the action is not applied). |
4049 |
> |
* for an element, or null if there is no transformation (in |
4050 |
> |
* which case the action is not applied) |
4051 |
|
* @param action the action |
4052 |
|
*/ |
4053 |
|
public <U> void forEachEntry(Fun<Map.Entry<K,V>, ? extends U> transformer, |
4091 |
|
* 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 |
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 |
4195 |
|
* |
4196 |
|
* @param map the map |
4197 |
|
* @param transformer a function returning the transformation |
4198 |
< |
* for an element, or null of there is no transformation (in |
4199 |
< |
* which case the action is not applied). |
4198 |
> |
* for an element, or null if there is no transformation (in |
4199 |
> |
* which case the action is not applied) |
4200 |
|
* @param action the action |
4201 |
|
* @return the task |
4202 |
|
*/ |
4238 |
|
* |
4239 |
|
* @param map the map |
4240 |
|
* @param transformer a function returning the transformation |
4241 |
< |
* for an element, or null of there is no transformation (in |
4241 |
> |
* for an element, or null if there is no transformation (in |
4242 |
|
* which case it is not combined). |
4243 |
|
* @param reducer a commutative associative combining function |
4244 |
|
* @return the task |
4345 |
|
* |
4346 |
|
* @param map the map |
4347 |
|
* @param transformer a function returning the transformation |
4348 |
< |
* for an element, or null of there is no transformation (in |
4349 |
< |
* which case the action is not applied). |
4348 |
> |
* for an element, or null if there is no transformation (in |
4349 |
> |
* which case the action is not applied) |
4350 |
|
* @param action the action |
4351 |
|
* @return the task |
4352 |
|
*/ |
4405 |
|
* |
4406 |
|
* @param map the map |
4407 |
|
* @param transformer a function returning the transformation |
4408 |
< |
* for an element, or null of there is no transformation (in |
4408 |
> |
* for an element, or null if there is no transformation (in |
4409 |
|
* which case it is not combined). |
4410 |
|
* @param reducer a commutative associative combining function |
4411 |
|
* @return the task |
4512 |
|
* |
4513 |
|
* @param map the map |
4514 |
|
* @param transformer a function returning the transformation |
4515 |
< |
* for an element, or null of there is no transformation (in |
4516 |
< |
* which case the action is not applied). |
4515 |
> |
* for an element, or null if there is no transformation (in |
4516 |
> |
* which case the action is not applied) |
4517 |
|
* @param action the action |
4518 |
|
*/ |
4519 |
|
public static <K,V,U> ForkJoinTask<Void> forEachValue |
4537 |
|
* @param searchFunction a function returning a non-null |
4538 |
|
* result on success, else null |
4539 |
|
* @return the task |
4541 |
– |
* |
4540 |
|
*/ |
4541 |
|
public static <K,V,U> ForkJoinTask<U> searchValues |
4542 |
|
(ConcurrentHashMapV8<K,V> map, |
4571 |
|
* |
4572 |
|
* @param map the map |
4573 |
|
* @param transformer a function returning the transformation |
4574 |
< |
* for an element, or null of there is no transformation (in |
4574 |
> |
* for an element, or null if there is no transformation (in |
4575 |
|
* which case it is not combined). |
4576 |
|
* @param reducer a commutative associative combining function |
4577 |
|
* @return the task |
4678 |
|
* |
4679 |
|
* @param map the map |
4680 |
|
* @param transformer a function returning the transformation |
4681 |
< |
* for an element, or null of there is no transformation (in |
4682 |
< |
* which case the action is not applied). |
4681 |
> |
* for an element, or null if there is no transformation (in |
4682 |
> |
* which case the action is not applied) |
4683 |
|
* @param action the action |
4684 |
|
*/ |
4685 |
|
public static <K,V,U> ForkJoinTask<Void> forEachEntry |
4703 |
|
* @param searchFunction a function returning a non-null |
4704 |
|
* result on success, else null |
4705 |
|
* @return the task |
4708 |
– |
* |
4706 |
|
*/ |
4707 |
|
public static <K,V,U> ForkJoinTask<U> searchEntries |
4708 |
|
(ConcurrentHashMapV8<K,V> map, |
4737 |
|
* |
4738 |
|
* @param map the map |
4739 |
|
* @param transformer a function returning the transformation |
4740 |
< |
* for an element, or null of there is no transformation (in |
4740 |
> |
* for an element, or null if there is no transformation (in |
4741 |
|
* which case it is not combined). |
4742 |
|
* @param reducer a commutative associative combining function |
4743 |
|
* @return the task |
4843 |
|
int batch; // split control; -1 for unknown |
4844 |
|
int pending; // completion control |
4845 |
|
|
4846 |
< |
BulkTask(ConcurrentHashMapV8<K,V> map, BulkTask<K,V,?> parent, |
4846 |
> |
BulkTask(ConcurrentHashMapV8<K,V> map, BulkTask<K,V,?> parent, |
4847 |
|
int batch) { |
4848 |
|
super(map); |
4849 |
|
this.parent = parent; |
5436 |
|
if ((c = t.pending) == 0) { |
5437 |
|
for (s = t.rights; s != null; s = t.rights = s.nextRight) { |
5438 |
|
if ((sr = s.result) != null) |
5439 |
< |
t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr); |
5439 |
> |
t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr); |
5440 |
|
} |
5441 |
|
if ((par = t.parent) == null || |
5442 |
|
!(par instanceof ReduceKeysTask)) { |
5491 |
|
if ((c = t.pending) == 0) { |
5492 |
|
for (s = t.rights; s != null; s = t.rights = s.nextRight) { |
5493 |
|
if ((sr = s.result) != null) |
5494 |
< |
t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr); |
5494 |
> |
t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr); |
5495 |
|
} |
5496 |
|
if ((par = t.parent) == null || |
5497 |
|
!(par instanceof ReduceValuesTask)) { |
5546 |
|
if ((c = t.pending) == 0) { |
5547 |
|
for (s = t.rights; s != null; s = t.rights = s.nextRight) { |
5548 |
|
if ((sr = s.result) != null) |
5549 |
< |
t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr); |
5549 |
> |
t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr); |
5550 |
|
} |
5551 |
|
if ((par = t.parent) == null || |
5552 |
|
!(par instanceof ReduceEntriesTask)) { |
5605 |
|
if ((c = t.pending) == 0) { |
5606 |
|
for (s = t.rights; s != null; s = t.rights = s.nextRight) { |
5607 |
|
if ((sr = s.result) != null) |
5608 |
< |
t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr); |
5608 |
> |
t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr); |
5609 |
|
} |
5610 |
|
if ((par = t.parent) == null || |
5611 |
|
!(par instanceof MapReduceKeysTask)) { |
5665 |
|
if ((c = t.pending) == 0) { |
5666 |
|
for (s = t.rights; s != null; s = t.rights = s.nextRight) { |
5667 |
|
if ((sr = s.result) != null) |
5668 |
< |
t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr); |
5668 |
> |
t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr); |
5669 |
|
} |
5670 |
|
if ((par = t.parent) == null || |
5671 |
|
!(par instanceof MapReduceValuesTask)) { |
5725 |
|
if ((c = t.pending) == 0) { |
5726 |
|
for (s = t.rights; s != null; s = t.rights = s.nextRight) { |
5727 |
|
if ((sr = s.result) != null) |
5728 |
< |
t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr); |
5728 |
> |
t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr); |
5729 |
|
} |
5730 |
|
if ((par = t.parent) == null || |
5731 |
|
!(par instanceof MapReduceEntriesTask)) { |
5785 |
|
if ((c = t.pending) == 0) { |
5786 |
|
for (s = t.rights; s != null; s = t.rights = s.nextRight) { |
5787 |
|
if ((sr = s.result) != null) |
5788 |
< |
t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr); |
5788 |
> |
t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr); |
5789 |
|
} |
5790 |
|
if ((par = t.parent) == null || |
5791 |
|
!(par instanceof MapReduceMappingsTask)) { |