Package ch.bailu.gtk.glib
Klasse Rand
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.glib.Rand
- Alle implementierten Schnittstellen:
PointerInterface
The GRand struct is an opaque data structure. It should only be
accessed through the g_rand_* functions.
accessed through the g_rand_* functions.
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungRand()
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).Rand
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdouble
_double()
Returns the next random #gdouble from @rand_ equally distributed over
the range [0..1).int
_int()
Returns the next random #guint32 from @rand_ equally distributed over
the range [0..2^32-1].copy()
Copies a #GRand into a new one with the same exact state as before.double
doubleRange
(double begin, double end) Returns the next random #gdouble from @rand_ equally distributed over
the range [@begin..@end).void
free()
Frees the memory allocated for the #GRand.static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
int
intRange
(int begin, int end) Returns the next random #gint32 from @rand_ equally distributed over
the range [@begin..@end-1].static Rand
newWithSeedRand
(int seed) Creates a new random number generator initialized with @seed.void
setSeed
(int seed) Sets the seed for the random number generator #GRand to @seed.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
Rand
-
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
-
newWithSeedRand
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
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 intervalend
- 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 intervalend
- 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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-