Klasse Rand

Alle implementierten Schnittstellen:
PointerInterface

public class Rand extends Record
The GRand struct is an opaque data structure. It should only be
accessed through the g_rand_* functions.

https://docs.gtk.org/glib/struct.Rand.html

  • Konstruktordetails

    • Rand

      public Rand(PointerContainer pointer)
    • Rand

      public Rand()
      Creates a new random number generator initialized with a seed taken
      either from `/dev/urandom` (if existing) or from the current time
      (as a fallback).

      On Windows, the seed is taken from rand_s().
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newWithSeedRand

      public static Rand newWithSeedRand(int seed)
      Creates a new random number generator initialized with @seed.
      Parameter:
      seed - a value to initialize the random number generator
      Gibt zurück:
      the new #GRand
    • copy

      public Rand copy()
      Copies a #GRand into a new one with the same exact state as before.
      This way you can take a snapshot of the random number generator for
      replaying later.
      Gibt zurück:
      the new #GRand
    • _double

      public double _double()
      Returns the next random #gdouble from @rand_ equally distributed over
      the range [0..1).
      Gibt zurück:
      a random number
    • doubleRange

      public double doubleRange(double begin, double end)
      Returns the next random #gdouble from @rand_ equally distributed over
      the range [@begin..@end).
      Parameter:
      begin - lower closed bound of the interval
      end - upper open bound of the interval
      Gibt zurück:
      a random number
    • free

      public void free()
      Frees the memory allocated for the #GRand.
    • _int

      public int _int()
      Returns the next random #guint32 from @rand_ equally distributed over
      the range [0..2^32-1].
      Gibt zurück:
      a random number
    • intRange

      public int intRange(int begin, int end)
      Returns the next random #gint32 from @rand_ equally distributed over
      the range [@begin..@end-1].
      Parameter:
      begin - lower closed bound of the interval
      end - upper open bound of the interval
      Gibt zurück:
      a random number
    • setSeed

      public void setSeed(int seed)
      Sets the seed for the random number generator #GRand to @seed.
      Parameter:
      seed - a value to reinitialize the random number generator
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()