@NoOffset @Properties(inherit=ale.class) public class Random extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
Random()
Create a new random number generator
|
Random(long size)
Native array allocator.
|
Random(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Random |
getInstance() |
Random |
getPointer(long i) |
boolean |
loadState(Deserializer in)
Deserializes the RNG state.
|
int |
next()
Answer the next random number from the random number generator
|
double |
nextDouble()
Answer the next random number between 0 and 1 from the random number generator
|
Random |
position(long position) |
boolean |
saveState(Serializer out)
Serializes the RNG state.
|
void |
seed(int value)
Class method which allows you to set the seed that'll be used
for created new instances of this class
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getPointer, getPointer, getPointer, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeropublic Random(Pointer p)
Pointer.Pointer(Pointer).public Random(long size)
Pointer.position(long).public Random()
public Random getPointer(long i)
getPointer in class Pointerpublic void seed(@Cast(value="uInt32") int value)
value - The value to seed the random number generator with@Cast(value="uInt32") public int next()
public double nextDouble()
@Cast(value="bool") public boolean saveState(@ByRef Serializer out)
@Cast(value="bool") public boolean loadState(@ByRef Deserializer in)
Copyright © 2020. All rights reserved.