311 |
|
* evenly divisible by the range. The loop rejects candidates |
312 |
|
* computed from otherwise over-represented values. The |
313 |
|
* expected number of iterations under an ideal generator |
314 |
< |
* varies from 1 to 2, depending on the bound. |
314 |
> |
* varies from 1 to 2, depending on the bound. The loop itself |
315 |
> |
* takes an unlovable form. Because the first candidate is |
316 |
> |
* already available, we need a break-in-the-middle |
317 |
> |
* construction, which is concisely but cryptically performed |
318 |
> |
* within the while-condition of a body-less for loop. |
319 |
|
* |
320 |
|
* 4. Otherwise, the range cannot be represented as a positive |
321 |
< |
* long. Repeatedly generate unbounded longs until obtaining |
322 |
< |
* a candidate meeting constraints (with an expected number of |
323 |
< |
* iterations of less than two). |
321 |
> |
* long. The loop repeatedly generates unbounded longs until |
322 |
> |
* obtaining a candidate meeting constraints (with an expected |
323 |
> |
* number of iterations of less than two). |
324 |
|
*/ |
325 |
|
|
326 |
|
long r = mix64(nextSeed()); |
873 |
|
|
874 |
|
public int characteristics() { |
875 |
|
return (Spliterator.SIZED | Spliterator.SUBSIZED | |
876 |
< |
Spliterator.ORDERED | Spliterator.NONNULL | |
873 |
< |
Spliterator.IMMUTABLE); |
876 |
> |
Spliterator.NONNULL | Spliterator.IMMUTABLE); |
877 |
|
} |
878 |
|
|
879 |
|
public boolean tryAdvance(IntConsumer consumer) { |
927 |
|
|
928 |
|
public int characteristics() { |
929 |
|
return (Spliterator.SIZED | Spliterator.SUBSIZED | |
930 |
< |
Spliterator.ORDERED | Spliterator.NONNULL | |
928 |
< |
Spliterator.IMMUTABLE); |
930 |
> |
Spliterator.NONNULL | Spliterator.IMMUTABLE); |
931 |
|
} |
932 |
|
|
933 |
|
public boolean tryAdvance(LongConsumer consumer) { |
982 |
|
|
983 |
|
public int characteristics() { |
984 |
|
return (Spliterator.SIZED | Spliterator.SUBSIZED | |
985 |
< |
Spliterator.ORDERED | Spliterator.NONNULL | |
984 |
< |
Spliterator.IMMUTABLE); |
985 |
> |
Spliterator.NONNULL | Spliterator.IMMUTABLE); |
986 |
|
} |
987 |
|
|
988 |
|
public boolean tryAdvance(DoubleConsumer consumer) { |