/** * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive. * * @param max the upper limit of the random number selection * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { return RandomUtil.randomInterval(0, max); } }
/** * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { if (pos == -1) { pos = RandomUtil.randomInterval(0, max); } return pos; } }
@Override public int select(final int max) { if (first) { // We start on a random one pos = RandomUtil.randomInterval(0, max); first = false; } else { pos++; if (pos >= max) { pos = 0; } } return pos; } }
@Override public void openBroadcaster() throws Exception { if (localBindPort != -1) { broadcastingSocket = new DatagramSocket(localBindPort, localAddress); } else { if (localAddress != null) { for (int i = 0; i < 100; i++) { int nextPort = RandomUtil.randomInterval(3000, 4000); try { broadcastingSocket = new DatagramSocket(nextPort, localAddress); ActiveMQClientLogger.LOGGER.broadcastGroupBindError(localAddress.toString() + ":" + nextPort); break; } catch (Exception e) { ActiveMQClientLogger.LOGGER.broadcastGroupBindErrorRetry(localAddress.toString() + ":" + nextPort, e); } } } if (broadcastingSocket == null) { broadcastingSocket = new DatagramSocket(); } } open = true; }
/** * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive. * * @param max the upper limit of the random number selection * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { return RandomUtil.randomInterval(0, max); } }
/** * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive. * * @param max the upper limit of the random number selection * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { return RandomUtil.randomInterval(0, max); } }
/** * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { if (pos == -1) { pos = RandomUtil.randomInterval(0, max); } return pos; } }
/** * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive. * * @param max the upper limit of the random number selection * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { return RandomUtil.randomInterval(0, max); } }
/** * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { if (pos == -1) { pos = RandomUtil.randomInterval(0, max); } return pos; } }
/** * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive. * * @param max the upper limit of the random number selection * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { return RandomUtil.randomInterval(0, max); } }
/** * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { if (pos == -1) { pos = RandomUtil.randomInterval(0, max); } return pos; } }
/** * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive. * * @param max the upper limit of the random number selection * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { return RandomUtil.randomInterval(0, max); } }
/** * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { if (pos == -1) { pos = RandomUtil.randomInterval(0, max); } return pos; } }
/** * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { if (pos == -1) { pos = RandomUtil.randomInterval(0, max); } return pos; } }
@Override public int select(final int max) { if (first) { // We start on a random one pos = RandomUtil.randomInterval(0, max); first = false; } else { pos++; if (pos >= max) { pos = 0; } } return pos; } }
/** * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive. * * @param max the upper limit of the random number selection * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { return RandomUtil.randomInterval(0, max); } }
/** * @see java.util.Random#nextInt(int) */ @Override public int select(final int max) { if (pos == -1) { pos = RandomUtil.randomInterval(0, max); } return pos; } }
@Override public int select(final int max) { if (first) { // We start on a random one pos = RandomUtil.randomInterval(0, max); first = false; } else { pos++; if (pos >= max) { pos = 0; } } return pos; } }
@Override public int select(final int max) { if (first) { // We start on a random one pos = RandomUtil.randomInterval(0, max); first = false; } else { pos++; if (pos >= max) { pos = 0; } } return pos; } }
public static void main(String[] arg) { long start = Long.parseLong(arg[0]); try { Thread.sleep((start - System.currentTimeMillis()) / 2); } catch (Exception e) { } while (System.currentTimeMillis() < start) { Thread.yield(); } int value; value = RandomUtil.randomInterval(0, 255); System.exit(value); }