Java Random Long randLong(long minimum, long maximum)

Here you can find the source of randLong(long minimum, long maximum)

Description

rand Long

License

Open Source License

Declaration

public static Long randLong(long minimum, long maximum) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Random;

public class Main {
    private static final Random seed = new Random();

    public static Long randLong(long minimum, long maximum) {
        assert minimum <= maximum;
        long value = Math.abs(seed.nextLong()) % (maximum - minimum + 1) + minimum;
        assert minimum <= value && value <= maximum;
        return value;
    }//from w w w.  j a v  a  2  s .  c om
}

Related

  1. nextLong(Random random, final long lower, final long upper)
  2. nextLong(Random rng, long n)
  3. nextLong(Random rng, long n)
  4. nextLongId()
  5. randLong()
  6. randLong(long n)
  7. random(long begin, long end)
  8. random(long max)
  9. random(long min, long max)