Interface RandomNumberEngine
- All Superinterfaces:
AutoCloseable,Comparable<JoltPhysicsObject>,ConstJoltPhysicsObject
- All Known Implementing Classes:
DefaultRandomEngine,Mt19937
Interface to a pseudo-random number engine.
-
Method Summary
Modifier and TypeMethodDescriptionlongmax()Return the maximum value that can be generated.longmin()Return the minimum value that can be generated.intnextInt()Return the next integer in the sequence.longReturn the next integer in the sequence.voidseed(int value) Seed the engine with the specified value.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa, targetVaOrZero
-
Method Details
-
max
long max()Return the maximum value that can be generated.- Returns:
- an unsigned 32-bit value
-
min
long min()Return the minimum value that can be generated.- Returns:
- an unsigned 32-bit value
-
nextInt
int nextInt()Return the next integer in the sequence.- Returns:
- a signed 32-bit value
-
nextUnsigned
long nextUnsigned()Return the next integer in the sequence.- Returns:
- an unsigned 32-bit value
-
seed
void seed(int value) Seed the engine with the specified value.- Parameters:
value- the value to use
-