Home | History | Annotate | Download | only in concurrent

Lines Matching defs:origin

203      * origin is greater than bound, acts as unbounded form of
206 * @param origin the least value, unless greater than bound
207 * @param bound the upper bound (exclusive), must not equal origin
210 final long internalNextLong(long origin, long bound) {
212 if (origin < bound) {
213 long n = bound - origin, m = n - 1;
215 r = (r & m) + origin;
221 r += origin;
224 while (r < origin || r >= bound)
235 * @param origin the least value, unless greater than bound
236 * @param bound the upper bound (exclusive), must not equal origin
239 final int internalNextInt(int origin, int bound) {
241 if (origin < bound) {
242 int n = bound - origin, m = n - 1;
244 r = (r & m) + origin;
250 r += origin;
253 while (r < origin || r >= bound)
263 * @param origin the least value, unless greater than bound
264 * @param bound the upper bound (exclusive), must not equal origin
267 final double internalNextDouble(double origin, double bound) {
269 if (origin < bound) {
270 r = r * (bound - origin) + origin;
313 * origin (inclusive) and the specified bound (exclusive).
315 * @param origin the least value returned
317 * @return a pseudorandom {@code int} value between the origin
319 * @throws IllegalArgumentException if {@code origin} is greater than
322 public int nextInt(int origin, int bound) {
323 if (origin >= bound)
325 return internalNextInt(origin, bound);
364 * origin (inclusive) and the specified bound (exclusive).
366 * @param origin the least value returned
368 * @return a pseudorandom {@code long} value between the origin
370 * @throws IllegalArgumentException if {@code origin} is greater than
373 public long nextLong(long origin, long bound) {
374 if (origin >= bound)
376 return internalNextLong(origin, bound);
409 * origin (inclusive) and bound (exclusive).
411 * @param origin the least value returned
413 * @return a pseudorandom {@code double} value between the origin
415 * @throws IllegalArgumentException if {@code origin} is greater than
418 public double nextDouble(double origin, double bound) {
419 if (!(origin < bound))
421 return internalNextDouble(origin, bound);
503 * origin (inclusive) and bound (exclusive).
506 * @param randomNumberOrigin the origin (inclusive) of each random value
509 * each with the given origin (inclusive) and bound (exclusive)
529 * int} values, each conforming to the given origin (inclusive) and bound
535 * @param randomNumberOrigin the origin (inclusive) of each random value
538 * each with the given origin (inclusive) and bound (exclusive)
590 * pseudorandom {@code long}, each conforming to the given origin
594 * @param randomNumberOrigin the origin (inclusive) of each random value
597 * each with the given origin (inclusive) and bound (exclusive)
617 * long} values, each conforming to the given origin (inclusive) and bound
623 * @param randomNumberOrigin the origin (inclusive) of each random value
626 * each with the given origin (inclusive) and bound (exclusive)
680 * pseudorandom {@code double} values, each conforming to the given origin
684 * @param randomNumberOrigin the origin (inclusive) of each random value
687 * each with the given origin (inclusive) and bound (exclusive)
708 * double} values, each conforming to the given origin (inclusive) and bound
714 * @param randomNumberOrigin the origin (inclusive) of each random value
717 * each with the given origin (inclusive) and bound (exclusive)
733 * versions into one class by treating a bound less than origin as
743 final int origin;
746 int origin, int bound) {
748 this.origin = origin; this.bound = bound;
754 new RandomIntsSpliterator(i, index = m, origin, bound);
770 consumer.accept(ThreadLocalRandom.current().internalNextInt(origin, bound));
782 int o = origin, b = bound;
798 final long origin;
801 long origin, long bound) {
803 this.origin = origin; this.bound = bound;
809 new RandomLongsSpliterator(i, index = m, origin, bound);
825 consumer.accept(ThreadLocalRandom.current().internalNextLong(origin, bound));
837 long o = origin, b = bound;
854 final double origin;
857 double origin, double bound) {
859 this.origin = origin; this.bound = bound;
865 new RandomDoublesSpliterator(i, index = m, origin, bound);
881 consumer.accept(ThreadLocalRandom.current().internalNextDouble(origin, bound));
893 double o = origin, b = bound;
1020 static final String BAD_RANGE = "bound must be greater than origin";