131 |
|
* because they have negative hash fields and null key and value |
132 |
|
* fields. (These special nodes are either uncommon or transient, |
133 |
|
* so the impact of carrying around some unused fields is |
134 |
< |
* insignficant.) |
134 |
> |
* insignificant.) |
135 |
|
* |
136 |
|
* The table is lazily initialized to a power-of-two size upon the |
137 |
|
* first insertion. Each bin in the table normally contains a |
294 |
|
* |
295 |
|
* TreeBins also require an additional locking mechanism. While |
296 |
|
* list traversal is always possible by readers even during |
297 |
< |
* updates, tree traversal is not, mainly beause of tree-rotations |
297 |
> |
* updates, tree traversal is not, mainly because of tree-rotations |
298 |
|
* that may change the root node and/or its linkages. TreeBins |
299 |
|
* include a simple read-write lock mechanism parasitic on the |
300 |
|
* main bin-synchronization strategy: Structural adjustments |
401 |
|
* Encodings for Node hash fields. See above for explanation. |
402 |
|
*/ |
403 |
|
static final int MOVED = 0x8fffffff; // (-1) hash for forwarding nodes |
404 |
< |
static final int TREEBIN = 0x80000000; // hash for heads of treea |
404 |
> |
static final int TREEBIN = 0x80000000; // hash for roots of trees |
405 |
|
static final int RESERVED = 0x80000001; // hash for transient reservations |
406 |
|
static final int HASH_BITS = 0x7fffffff; // usable bits of normal node hash |
407 |
|
|
421 |
|
* Key-value entry. This class is never exported out as a |
422 |
|
* user-mutable Map.Entry (i.e., one supporting setValue; see |
423 |
|
* MapEntry below), but can be used for read-only traversals used |
424 |
< |
* in bulk tasks. Subclasses of Node with a negativehash field |
424 |
> |
* in bulk tasks. Subclasses of Node with a negative hash field |
425 |
|
* are special, and contain null keys and values (but are never |
426 |
|
* exported). Otherwise, keys and vals are never null. |
427 |
|
*/ |
2008 |
|
|
2009 |
|
/** |
2010 |
|
* Returns matching node or null if none. Tries to search |
2011 |
< |
* using tree compareisons from root, but continues linear |
2011 |
> |
* using tree comparisons from root, but continues linear |
2012 |
|
* search when lock not available. |
2013 |
|
*/ |
2014 |
|
final Node<K,V> find(int h, Object k) { |