299 |
|
* because they have negative hash fields and null key and value |
300 |
|
* fields. (These special nodes are either uncommon or transient, |
301 |
|
* so the impact of carrying around some unused fields is |
302 |
< |
* insignficant.) |
302 |
> |
* insignificant.) |
303 |
|
* |
304 |
|
* The table is lazily initialized to a power-of-two size upon the |
305 |
|
* first insertion. Each bin in the table normally contains a |
462 |
|
* |
463 |
|
* TreeBins also require an additional locking mechanism. While |
464 |
|
* list traversal is always possible by readers even during |
465 |
< |
* updates, tree traversal is not, mainly beause of tree-rotations |
465 |
> |
* updates, tree traversal is not, mainly because of tree-rotations |
466 |
|
* that may change the root node and/or its linkages. TreeBins |
467 |
|
* include a simple read-write lock mechanism parasitic on the |
468 |
|
* main bin-synchronization strategy: Structural adjustments |
569 |
|
* Encodings for Node hash fields. See above for explanation. |
570 |
|
*/ |
571 |
|
static final int MOVED = 0x8fffffff; // (-1) hash for forwarding nodes |
572 |
< |
static final int TREEBIN = 0x80000000; // hash for heads of treea |
572 |
> |
static final int TREEBIN = 0x80000000; // hash for roots of trees |
573 |
|
static final int RESERVED = 0x80000001; // hash for transient reservations |
574 |
|
static final int HASH_BITS = 0x7fffffff; // usable bits of normal node hash |
575 |
|
|
589 |
|
* Key-value entry. This class is never exported out as a |
590 |
|
* user-mutable Map.Entry (i.e., one supporting setValue; see |
591 |
|
* MapEntry below), but can be used for read-only traversals used |
592 |
< |
* in bulk tasks. Subclasses of Node with a negativehash field |
592 |
> |
* in bulk tasks. Subclasses of Node with a negative hash field |
593 |
|
* are special, and contain null keys and values (but are never |
594 |
|
* exported). Otherwise, keys and vals are never null. |
595 |
|
*/ |
2653 |
|
|
2654 |
|
/** |
2655 |
|
* Returns matching node or null if none. Tries to search |
2656 |
< |
* using tree compareisons from root, but continues linear |
2656 |
> |
* using tree comparisons from root, but continues linear |
2657 |
|
* search when lock not available. |
2658 |
|
*/ |
2659 |
|
final Node<K,V> find(int h, Object k) { |
2751 |
|
* that are accessible independently of lock. So instead we |
2752 |
|
* swap the tree linkages. |
2753 |
|
* |
2754 |
< |
* @return true if now too small so should be untreeified. |
2754 |
> |
* @return true if now too small, so should be untreeified |
2755 |
|
*/ |
2756 |
|
final boolean removeTreeNode(TreeNode<K,V> p) { |
2757 |
|
TreeNode<K,V> next = (TreeNode<K,V>)p.next; |
3498 |
|
* of all (key, value) pairs |
3499 |
|
* @since 1.8 |
3500 |
|
*/ |
3501 |
< |
public double reduceToDoubleIn(long parallelismThreshold, |
3502 |
< |
ObjectByObjectToDouble<? super K, ? super V> transformer, |
3503 |
< |
double basis, |
3504 |
< |
DoubleByDoubleToDouble reducer) { |
3501 |
> |
public double reduceToDouble(long parallelismThreshold, |
3502 |
> |
ObjectByObjectToDouble<? super K, ? super V> transformer, |
3503 |
> |
double basis, |
3504 |
> |
DoubleByDoubleToDouble reducer) { |
3505 |
|
if (transformer == null || reducer == null) |
3506 |
|
throw new NullPointerException(); |
3507 |
|
return new MapReduceMappingsToDoubleTask<K,V> |