List of utility methods to do Random Long
Random | generateRandomBySampleSeed(long sampleSeed, long fallbackValue) Generate random instance according to sample seed. if (sampleSeed != fallbackValue) { return new Random(sampleSeed); return new Random(); |
long | generateRandomLongValue() generate Random Long Value long randomID = generateRandomLongValue(MIN_SEED, Long.MAX_VALUE); return randomID; |
long | getLong() Get next random long value. return random.nextLong();
|
long | getLong() Gets a random long. return RANDOM.nextLong();
|
long | getLongBetween(long n, long m) get Long Between if (m <= n) { return n; long res = getLongMoreThanZero(); return n + res % (m - n); |
long | getLongInRange(long minValue, long maxValue) It returns a long/Long value between min and max value (included). return (long) (getDoubleInRange(minValue - 0.5, maxValue + 0.5 - (1 / Long.MAX_VALUE)) + 0.5); |
long | getLongSpecial() get Long Special int i = rng.nextInt(); long j = rng.nextLong(); if ((i & 0x10) != 0) return j; return lspecial[((int) j & 0x7fffffff) % special.length] * ((i & 0x20) == 0 ? 1 : -1) + ((i & 0x03) - 1); |
long[] | getLongSpecialCases() Testing helper method. long longs[] = new long[100]; int i = 0; longs[i++] = Long.MAX_VALUE; longs[i++] = Long.MAX_VALUE - 1L; longs[i++] = (long) Integer.MAX_VALUE + 1L; longs[i++] = Integer.MAX_VALUE; longs[i++] = Integer.MAX_VALUE - 1; longs[i++] = 100L; ... |
long | getRandomLong() Generates next random long Random rand = new Random(System.currentTimeMillis()); return rand.nextLong(); |
double | nextLong() next Long return random.nextDouble();
|