212 |
|
* highly contended cases. |
213 |
|
* |
214 |
|
* Unlike most skip-list implementations, index insertion and |
215 |
< |
* deletion here require a separate traversal pass occuring after |
215 |
> |
* deletion here require a separate traversal pass occurring after |
216 |
|
* the base-level action, to add or remove index nodes. This adds |
217 |
|
* to single-threaded overhead, but improves contended |
218 |
|
* multithreaded performance by narrowing interference windows, |
766 |
|
} |
767 |
|
|
768 |
|
/** |
769 |
< |
* Returns node holding key or null if no such, clearing out any |
769 |
> |
* Returns node holding key, or null if no such, clearing out any |
770 |
|
* deleted nodes seen along the way. Repeatedly traverses at |
771 |
|
* base-level looking for key starting at predecessor returned |
772 |
|
* from findPredecessor, processing base-level deletions as |
917 |
|
* Main insertion method. Adds element if not present, or |
918 |
|
* replaces value if present and onlyIfAbsent is false. |
919 |
|
* @param kkey the key |
920 |
< |
* @param value the value that must be associated with key |
920 |
> |
* @param value the value that must be associated with key |
921 |
|
* @param onlyIfAbsent if should not insert if already present |
922 |
|
* @return the old value, or null if newly inserted |
923 |
|
*/ |
2842 |
|
} |
2843 |
|
|
2844 |
|
final class DescendingEntryIterator extends EntryIter |
2845 |
< |
implements Iterator<Map.Entry<K,V>> { |
2845 |
> |
implements Iterator<Map.Entry<K,V>> { |
2846 |
|
DescendingEntryIterator() { |
2847 |
|
initDescending(); |
2848 |
|
} |
2854 |
|
} |
2855 |
|
|
2856 |
|
final class DescendingSubMapEntryIterator extends EntryIter |
2857 |
< |
implements Iterator<Map.Entry<K,V>> { |
2857 |
> |
implements Iterator<Map.Entry<K,V>> { |
2858 |
|
final K least; |
2859 |
|
DescendingSubMapEntryIterator(K least, K fence) { |
2860 |
|
initDescending(least, fence); |
3049 |
|
/** |
3050 |
|
* Creates a new submap. |
3051 |
|
* @param least inclusive least value, or {@code null} if from start |
3052 |
< |
* @param fence exclusive upper bound or {@code null} if to end |
3052 |
> |
* @param fence exclusive upper bound, or {@code null} if to end |
3053 |
|
* @throws IllegalArgumentException if least and fence non-null |
3054 |
|
* and least greater than fence |
3055 |
|
*/ |
3104 |
|
|
3105 |
|
/** |
3106 |
|
* Returns least key. Needed by ConcurrentSkipListSet. |
3107 |
< |
* @return least key or {@code null} if from start |
3107 |
> |
* @return least key, or {@code null} if from start |
3108 |
|
*/ |
3109 |
|
K getLeast() { |
3110 |
|
return least; |
3112 |
|
|
3113 |
|
/** |
3114 |
|
* Returns fence key. Needed by ConcurrentSkipListSet. |
3115 |
< |
* @return fence key or {@code null} of to end |
3115 |
> |
* @return fence key, or {@code null} if to end |
3116 |
|
*/ |
3117 |
|
K getFence() { |
3118 |
|
return fence; |