Lines Matching defs:origin

224     static final String BAD_RANGE = "bound must be greater than origin";
251 * the public nextX(origin, bound) methods. These exist mainly to
258 * origin is greater than bound, acts as unbounded form of
261 * @param origin the least value, unless greater than bound
262 * @param bound the upper bound (exclusive), must not equal origin
265 final long internalNextLong(long origin, long bound) {
293 if (origin < bound) {
294 long n = bound - origin, m = n - 1;
296 r = (r & m) + origin;
302 r += origin;
305 while (r < origin || r >= bound)
316 * @param origin the least value, unless greater than bound
317 * @param bound the upper bound (exclusive), must not equal origin
320 final int internalNextInt(int origin, int bound) {
322 if (origin < bound) {
323 int n = bound - origin, m = n - 1;
325 r = (r & m) + origin;
331 r += origin;
334 while (r < origin || r >= bound)
344 * @param origin the least value, unless greater than bound
345 * @param bound the upper bound (exclusive), must not equal origin
348 final double internalNextDouble(double origin, double bound) {
350 if (origin < bound) {
351 r = r * (bound - origin) + origin;
422 // Specialize internalNextInt for origin 0
438 * origin (inclusive) and the specified bound (exclusive).
440 * @param origin the least value returned
442 * @return a pseudorandom {@code int} value between the origin
444 * @throws IllegalArgumentException if {@code origin} is greater than
447 public int nextInt(int origin, int bound) {
448 if (origin >= bound)
450 return internalNextInt(origin, bound);
474 // Specialize internalNextLong for origin 0
490 * origin (inclusive) and the specified bound (exclusive).
492 * @param origin the least value returned
494 * @return a pseudorandom {@code long} value between the origin
496 * @throws IllegalArgumentException if {@code origin} is greater than
499 public long nextLong(long origin, long bound) {
500 if (origin >= bound)
502 return internalNextLong(origin, bound);
535 * origin (inclusive) and bound (exclusive).
537 * @param origin the least value returned
539 * @return a pseudorandom {@code double} value between the origin
541 * @throws IllegalArgumentException if {@code origin} is greater than
544 public double nextDouble(double origin, double bound) {
545 if (!(origin < bound))
547 return internalNextDouble(origin, bound);
600 * from it; each value conforms to the given origin (inclusive) and bound
604 * @param randomNumberOrigin the origin (inclusive) of each random value
607 * each with the given origin (inclusive) and bound (exclusive)
627 * conforms to the given origin (inclusive) and bound (exclusive).
632 * @param randomNumberOrigin the origin (inclusive) of each random value
635 * each with the given origin (inclusive) and bound (exclusive)
686 * from it; each value conforms to the given origin (inclusive) and bound
690 * @param randomNumberOrigin the origin (inclusive) of each random value
693 * each with the given origin (inclusive) and bound (exclusive)
713 * conforms to the given origin (inclusive) and bound (exclusive).
718 * @param randomNumberOrigin the origin (inclusive) of each random value
721 * each with the given origin (inclusive) and bound (exclusive)
773 * from it; each value conforms to the given origin (inclusive) and bound
777 * @param randomNumberOrigin the origin (inclusive) of each random value
780 * each with the given origin (inclusive) and bound (exclusive)
801 * conforms to the given origin (inclusive) and bound (exclusive).
806 * @param randomNumberOrigin the origin (inclusive) of each random value
809 * each with the given origin (inclusive) and bound (exclusive)
824 * versions into one class by treating a bound less than origin as
835 final int origin;
838 int origin, int bound) {
840 this.origin = origin; this.bound = bound;
846 new RandomIntsSpliterator(rng.split(), i, index = m, origin, bound);
862 consumer.accept(rng.internalNextInt(origin, bound));
875 int o = origin, b = bound;
891 final long origin;
894 long origin, long bound) {
896 this.origin = origin; this.bound = bound;
902 new RandomLongsSpliterator(rng.split(), i, index = m, origin, bound);
918 consumer.accept(rng.internalNextLong(origin, bound));
931 long o = origin, b = bound;
948 final double origin;
951 double origin, double bound) {
953 this.origin = origin; this.bound = bound;
959 new RandomDoublesSpliterator(rng.split(), i, index = m, origin, bound);
975 consumer.accept(rng.internalNextDouble(origin, bound));
988 double o = origin, b = bound;