Source Code
By: John Vasileff
License: http://opensource.org/licenses/MIT
Packages
com.vasileff.ceylon.random.java
Dependencies
ceylon.interop.java1.1.0
ceylon.math1.1.0
com.vasileff.ceylon.random.api0.0.4
java.base7
Functions
randomWholeSource Codeshared Whole randomWhole(Whole origin, Whole bound, Random random = ...)

Generate a pseudorandom Whole number in the range origin (inclusive) to bound (exclusive).

Parameters:
  • origin

    The lower bound, inclusive. May be negative.

  • bound

    The upper bound, exclusive. Must be greater than origin.

  • random = LCGRandom()

    The entropy source.

Throws
  • Exception

    if origin <= bound

randomWholeBitsSource Codeshared Whole randomWholeBits(Integer bits, Random random = ...)

Generate a Whole number holding bits pseudorandom bits. This method returns zero if bits <= 0.

Parameters:
  • bits

    The number of bits.

  • random = LCGRandom()

    The entropy source.

Classes
JavaRandomSource Codeshared final JavaRandom

A pseudorandom number generator backed by java.util.Random.

JavaRandomAdapterSource Codeshared JavaRandomAdapter<Delegate>
given Delegate satisfies Random

Adapts java.util.Random to Random.

JavaSecureRandomSource Codeshared final JavaSecureRandom

A cryptographically strong random number generator backed by java.security.SecureRandom.