Class DefaultRandom

    • Constructor Detail

      • DefaultRandom

        public DefaultRandom()
    • Method Detail

      • getByte

        public byte getByte()
        Description copied from interface: MRandom
        Return a random byte from -127 to 128
        Specified by:
        getByte in interface MRandom
        Returns:
        a random yte
      • getInt

        public int getInt()
        Description copied from interface: MRandom
        Return a random integer from 0 to INTEGER MAX.
        Specified by:
        getInt in interface MRandom
        Returns:
        a random integer
      • getDouble

        public double getDouble()
        Description copied from interface: MRandom
        Return a random double from 0 to 1
        Specified by:
        getDouble in interface MRandom
        Returns:
        random double
      • getLong

        public long getLong()
        Description copied from interface: MRandom
        Return a random long from 0 to LONG MAX.
        Specified by:
        getLong in interface MRandom
        Returns:
        random long
      • random

        protected double random()
        Overwrite this to deliver your own random numbers
        Returns:
      • getRandom

        public Random getRandom()
      • adaptTo

        public <T> T adaptTo​(Class<? extends T> ifc)
        Description copied from interface: MRandom
        Return an adaption of an random if available. e.g. java.util.Random and java.security.Random should be supported.
        Specified by:
        adaptTo in interface MRandom
        Parameters:
        ifc - Requested Interface or Class
        Returns:
        The instance of Ifc
      • getChar

        public char getChar()
        Description copied from interface: MRandom
        Return a random readable character
        Specified by:
        getChar in interface MRandom
        Returns:
        random character