List of utility methods to do Random Int
int | getRandomIntegerInRange(Random p_76136_0_, int p_76136_1_, int p_76136_2_) get Random Integer In Range return p_76136_1_ >= p_76136_2_ ? p_76136_1_ : p_76136_0_.nextInt(p_76136_2_ - p_76136_1_ + 1) + p_76136_1_;
|
int | getRandomIntegerInRange(Random random, int i, int j) get Random Integer In Range if (i >= j) { return i; } else { return random.nextInt((j - i) + 1) + i; |
String[] | getRandomInterests() get Random Interests final String[] interests = { "bioinformatics", "web development", "semantic web", "requiremens analysis", "system modeling", "project planning", "project management", "software engineering", "software development", "technical writing" }; Set<String> finalInterests = new HashSet<String>(); for (int i = 0; i < 3; i++) { finalInterests.add(interests[r.nextInt(interests.length)]); return finalInterests.toArray(new String[0]); ... |
int | getRandomIntFromRange(int min, int max) get Random Int From Range return min + (max > min ? random.nextInt(1 + max - min) : 0);
|
int[] | getRandomInts(int number) get Random Ints int[] randInts = new int[number]; List<Integer> temp = new ArrayList<Integer>(number); for (int i = 0; i < number; i++) { temp.add(i); int pos; for (int i = 0; i < number; i++) { pos = rand.nextInt(temp.size()); ... |
int | getRandomIntStr(int len) get Random Int Str if (len == 0) { len = 1; Random random = new Random(System.nanoTime()); return random.nextInt((10 ^ len) - 1); |
int | rand(int min, int max) Generates a random number return min + (int) (Math.random() * ((max - min) + 1)); |
int | rand(int size) rand return (int) (size * Math.random()); |
int | randBetween(int min, int max) rand Between if (max < min) throw new IllegalArgumentException("'max' < 'min' is not legal"); return (int) (Math.random() * (max - min) + min); |
int | randInRangeInc(int min, int max) rand In Range Inc return min + (int) (Math.random() * ((1 + max) - min)); |