419 |
|
* because callers will have already read value field and need |
420 |
|
* to use that read (not another done here) and so directly |
421 |
|
* test if value points to node. |
422 |
< |
* @param n a possibly null reference to a node |
422 |
> |
* |
423 |
|
* @return true if this node is a marker node |
424 |
|
*/ |
425 |
|
boolean isMarker() { |
468 |
|
* Returns value if this node contains a valid key-value pair, |
469 |
|
* else null. |
470 |
|
* @return this node's value if it isn't a marker or header or |
471 |
< |
* is deleted, else null. |
471 |
> |
* is deleted, else null |
472 |
|
*/ |
473 |
|
V getValidValue() { |
474 |
|
Object v = value; |
507 |
|
volatile Index<K,V> right; |
508 |
|
|
509 |
|
/** |
510 |
< |
* Creates index node with given values |
510 |
> |
* Creates index node with given values. |
511 |
|
*/ |
512 |
|
Index(Node<K,V> node, Index<K,V> down, Index<K,V> right) { |
513 |
|
this.node = node; |
1042 |
|
* Adds given index nodes from given level down to 1. |
1043 |
|
* @param idx the topmost index node being inserted |
1044 |
|
* @param h the value of head to use to insert. This must be |
1045 |
< |
* snapshotted by callers to provide correct insertion level |
1045 |
> |
* snapshotted by callers to provide correct insertion level. |
1046 |
|
* @param indexLevel the level of the index |
1047 |
|
*/ |
1048 |
|
private void addIndex(Index<K,V> idx, HeadIndex<K,V> h, int indexLevel) { |
1601 |
|
* Constructs a new map containing the same mappings as the given |
1602 |
|
* {@code SortedMap}, sorted according to the same ordering. |
1603 |
|
* @param m the sorted map whose mappings are to be placed in this |
1604 |
< |
* map, and whose comparator is to be used to sort this map. |
1604 |
> |
* map, and whose comparator is to be used to sort this map |
1605 |
|
* @throws NullPointerException if the specified sorted map is |
1606 |
< |
* {@code null}. |
1606 |
> |
* {@code null} |
1607 |
|
*/ |
1608 |
|
public ConcurrentSkipListMap(SortedMap<K, ? extends V> m) { |
1609 |
|
this.comparator = m.comparator(); |
2212 |
|
* if this map uses its keys' natural order. |
2213 |
|
* |
2214 |
|
* @return the comparator associated with this map, or |
2215 |
< |
* {@code null} if it uses its keys' natural sort method. |
2215 |
> |
* {@code null} if it uses its keys' natural sort method |
2216 |
|
*/ |
2217 |
|
public Comparator<? super K> comparator() { |
2218 |
|
return comparator; |
3253 |
|
|
3254 |
|
public Map.Entry<K,V> ceilingEntry(K key) { |
3255 |
|
return (SnapshotEntry<K,V>) |
3256 |
< |
m.getNear(key, m.GT|m.EQ, least, fence, false); |
3256 |
> |
m.getNear(key, GT|EQ, least, fence, false); |
3257 |
|
} |
3258 |
|
|
3259 |
|
public K ceilingKey(K key) { |
3260 |
|
return (K) |
3261 |
< |
m.getNear(key, m.GT|m.EQ, least, fence, true); |
3261 |
> |
m.getNear(key, GT|EQ, least, fence, true); |
3262 |
|
} |
3263 |
|
|
3264 |
|
public Map.Entry<K,V> lowerEntry(K key) { |
3265 |
|
return (SnapshotEntry<K,V>) |
3266 |
< |
m.getNear(key, m.LT, least, fence, false); |
3266 |
> |
m.getNear(key, LT, least, fence, false); |
3267 |
|
} |
3268 |
|
|
3269 |
|
public K lowerKey(K key) { |
3270 |
|
return (K) |
3271 |
< |
m.getNear(key, m.LT, least, fence, true); |
3271 |
> |
m.getNear(key, LT, least, fence, true); |
3272 |
|
} |
3273 |
|
|
3274 |
|
public Map.Entry<K,V> floorEntry(K key) { |
3275 |
|
return (SnapshotEntry<K,V>) |
3276 |
< |
m.getNear(key, m.LT|m.EQ, least, fence, false); |
3276 |
> |
m.getNear(key, LT|EQ, least, fence, false); |
3277 |
|
} |
3278 |
|
|
3279 |
|
public K floorKey(K key) { |
3280 |
|
return (K) |
3281 |
< |
m.getNear(key, m.LT|m.EQ, least, fence, true); |
3281 |
> |
m.getNear(key, LT|EQ, least, fence, true); |
3282 |
|
} |
3283 |
|
|
3284 |
|
|
3285 |
|
public Map.Entry<K,V> higherEntry(K key) { |
3286 |
|
return (SnapshotEntry<K,V>) |
3287 |
< |
m.getNear(key, m.GT, least, fence, false); |
3287 |
> |
m.getNear(key, GT, least, fence, false); |
3288 |
|
} |
3289 |
|
|
3290 |
|
public K higherKey(K key) { |
3291 |
|
return (K) |
3292 |
< |
m.getNear(key, m.GT, least, fence, true); |
3292 |
> |
m.getNear(key, GT, least, fence, true); |
3293 |
|
} |
3294 |
|
|
3295 |
|
public Map.Entry<K,V> firstEntry() { |