Here you can find the source of getNumberClose(int seed)
private static int getNumberClose(int seed)
//package com.java2s; //License from project: Apache License public class Main { private static java.util.Random ran = new java.util.Random(); private static int getNumberClose(int seed) { if (seed == 0) { return 0; }//ww w . j a va 2s .c om return getNumber() % (seed + 1); } private static int getNumberClose(int start, int end) { return start + getNumberClose(end - start); } private static long getNumberClose(long seed) { if (seed <= 0) { return 0; } return getNumberLong() % (seed + 1); } /**************************************************************/ private static int getNumber() { return Math.abs(ran.nextInt()); } private static int getNumber(int seed) { if (seed == 0) { return 0; } return getNumber() % seed; } private static int getNumber(int start, int end) { return start + getNumber(end - start); } private static long getNumberLong() { return Math.abs(ran.nextLong()); } }