List of utility methods to do Random Int
int | generateRandomIntValue() generate Random Int Value int randomID = (int) generateRandomLongValue(MIN_SEED, Integer.MAX_VALUE); return randomID; |
int | generateRandomNoInRange(int max, int min) Generates a random number in the provided range. return min + (int) Math.random() * ((max - min) + 1); |
int | generateRandomSeed(int min, int max) Generate min ~ max random number if (min == max) { return min; double seed = Math.random() * (max - min) + min; return (int) Math.round(seed); |
String | generateRandomTargetId(final String uniqueId, final int count) Generates a random target it in the form of T return generateRandomTargetId(uniqueId) + count;
|
int | getIntRandom(int i) get Int Random java.util.Random r = new java.util.Random(System.currentTimeMillis()); return r.nextInt(i); |
int | getIntRandomReqId() Method to get integer random id. Random random = new Random(); int n = random.nextInt(); if (n < 0) { n = -n; return n; |
int | getIntRandomValue(int paramInt) get Int Random Value if (paramInt == 0) { return paramInt; return new Random().nextInt(paramInt); |
int | getPositiveInt() get Positive Int int r = random.nextInt(); if (r < 0) { r = -r; return r; |
String | getRandom(int c) get Random Random r = new Random(); SimpleDateFormat format = new SimpleDateFormat("ssSSS"); Date d = new Date(); StringBuffer sb = new StringBuffer(); sb.append(format.format(d)); sb.append(r.nextInt(10)); return sb.toString(); |
int | getRandomInt() Generates a new random integer return random.nextInt();
|