Interface MRandom

  • All Known Implementing Classes:
    DefaultRandom

    public interface MRandom
    • Method Detail

      • getByte

        byte getByte()
        Return a random byte from -127 to 128
        Returns:
        a random yte
      • getInt

        int getInt()
        Return a random integer from 0 to INTEGER MAX.
        Returns:
        a random integer
      • getDouble

        double getDouble()
        Return a random double from 0 to 1
        Returns:
        random double
      • getLong

        long getLong()
        Return a random long from 0 to LONG MAX.
        Returns:
        random long
      • adaptTo

        <T> T adaptTo​(Class<? extends T> ifc)
               throws de.mhus.lib.errors.NotSupportedException
        Return an adaption of an random if available. e.g. java.util.Random and java.security.Random should be supported.
        Parameters:
        ifc - Requested Interface or Class
        Returns:
        The instance of Ifc
        Throws:
        de.mhus.lib.errors.NotSupportedException - If adaption was not possible.
      • getChar

        char getChar()
        Return a random readable character
        Returns:
        random character