105 |
|
*/ |
106 |
|
public static interface MappingFunction<K, V> { |
107 |
|
/** |
108 |
< |
* Returns a value for the given key, or null if there is no mapping |
108 |
> |
* Returns a value for the given key, or null if there is no mapping. |
109 |
|
* |
110 |
|
* @param key the (non-null) key |
111 |
|
* @return a value for the key, or null if none |
145 |
|
* framework. As illustrated here, Spliterators are well suited to |
146 |
|
* designs in which a task repeatedly splits off half its work |
147 |
|
* into forked subtasks until small enough to process directly, |
148 |
< |
* and then joins these subtasks. Variants of this style can be |
149 |
< |
* also be used in completion-based designs. |
148 |
> |
* and then joins these subtasks. Variants of this style can also |
149 |
> |
* be used in completion-based designs. |
150 |
|
* |
151 |
|
* <pre> |
152 |
|
* {@code ConcurrentHashMapV8<String, Long> m = ... |
192 |
|
* @return a Spliterator covering approximately half of the |
193 |
|
* elements |
194 |
|
* @throws IllegalStateException if this Spliterator has |
195 |
< |
* already commenced traversing elements. |
195 |
> |
* already commenced traversing elements |
196 |
|
*/ |
197 |
|
Spliterator<T> split(); |
198 |
|
|
204 |
|
* |
205 |
|
* @return a Spliterator covering the same range as this Spliterator. |
206 |
|
* @throws IllegalStateException if this Spliterator has |
207 |
< |
* already commenced traversing elements. |
207 |
> |
* already commenced traversing elements |
208 |
|
*/ |
209 |
|
Spliterator<T> clone(); |
210 |
|
} |
759 |
|
if (c != (pc = pk.getClass()) || |
760 |
|
!(k instanceof Comparable) || |
761 |
|
(dir = ((Comparable)k).compareTo((Comparable)pk)) == 0) { |
762 |
< |
dir = (c == pc)? 0 : c.getName().compareTo(pc.getName()); |
762 |
> |
dir = (c == pc) ? 0 : c.getName().compareTo(pc.getName()); |
763 |
|
TreeNode r = null, s = null, pl, pr; |
764 |
|
if (dir >= 0) { |
765 |
|
if ((pl = p.left) != null && h <= pl.hash) |
806 |
|
} |
807 |
|
|
808 |
|
/** |
809 |
< |
* Find or add a node |
809 |
> |
* Finds or adds a node. |
810 |
|
* @return null if added |
811 |
|
*/ |
812 |
|
@SuppressWarnings("unchecked") // suppress Comparable cast warning |
823 |
|
if (c != (pc = pk.getClass()) || |
824 |
|
!(k instanceof Comparable) || |
825 |
|
(dir = ((Comparable)k).compareTo((Comparable)pk)) == 0) { |
826 |
< |
dir = (c == pc)? 0 : c.getName().compareTo(pc.getName()); |
826 |
> |
dir = (c == pc) ? 0 : c.getName().compareTo(pc.getName()); |
827 |
|
TreeNode r = null, s = null, pl, pr; |
828 |
|
if (dir >= 0) { |
829 |
|
if ((pl = p.left) != null && h <= pl.hash) |
1017 |
|
sib = (xp = x.parent) == null ? null : xp.right; |
1018 |
|
} |
1019 |
|
if (sib != null) { |
1020 |
< |
sib.red = (xp == null)? false : xp.red; |
1020 |
> |
sib.red = (xp == null) ? false : xp.red; |
1021 |
|
if ((sr = sib.right) != null) |
1022 |
|
sr.red = false; |
1023 |
|
} |
1055 |
|
sib = (xp = x.parent) == null ? null : xp.left; |
1056 |
|
} |
1057 |
|
if (sib != null) { |
1058 |
< |
sib.red = (xp == null)? false : xp.red; |
1058 |
> |
sib.red = (xp == null) ? false : xp.red; |
1059 |
|
if ((sl = sib.left) != null) |
1060 |
|
sl.red = false; |
1061 |
|
} |
2012 |
|
} |
2013 |
|
|
2014 |
|
/** |
2015 |
< |
* Split a normal bin with list headed by e into lo and hi parts; |
2016 |
< |
* install in given table |
2015 |
> |
* Splits a normal bin with list headed by e into lo and hi parts; |
2016 |
> |
* installs in given table. |
2017 |
|
*/ |
2018 |
|
private static void splitBin(Node[] nextTab, int i, Node e) { |
2019 |
|
int bit = nextTab.length >>> 1; // bit to split on |
2043 |
|
} |
2044 |
|
|
2045 |
|
/** |
2046 |
< |
* Split a tree bin into lo and hi parts; install in given table |
2046 |
> |
* Splits a tree bin into lo and hi parts; installs in given table. |
2047 |
|
*/ |
2048 |
|
private static void splitTreeBin(Node[] nextTab, int i, TreeBin t) { |
2049 |
|
int bit = nextTab.length >>> 1; |