Java Utililty Methods Random Int

List of utility methods to do Random Int

Description

The list of methods to do Random Int are organized into topic(s).

Method

intgetRandomIntegerInRange(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_;
intgetRandomIntegerInRange(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]);
...
intgetRandomIntFromRange(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());
...
intgetRandomIntStr(int len)
get Random Int Str
if (len == 0) {
    len = 1;
Random random = new Random(System.nanoTime());
return random.nextInt((10 ^ len) - 1);
intrand(int min, int max)
Generates a random number
return min + (int) (Math.random() * ((max - min) + 1));
intrand(int size)
rand
return (int) (size * Math.random());
intrandBetween(int min, int max)
rand Between
if (max < min)
    throw new IllegalArgumentException("'max' < 'min' is not legal");
return (int) (Math.random() * (max - min) + min);
intrandInRangeInc(int min, int max)
rand In Range Inc
return min + (int) (Math.random() * ((1 + max) - min));