@ThreadSafe public class SlotCode extends Object
Generate a fixed-capacity slot of random numbers. Consume an empty slot each time a pseudo-random number is generated. Reset the current slot if there are no empty slots.
| Modifier and Type | Field and Description |
|---|---|
int |
size |
| Constructor and Description |
|---|
SlotCode(int size)
Init a fixed capacity [1,size] random slot
|
SlotCode(int size,
Random rand)
Init a fixed capacity [1,size] random slot whit given random
|
SlotCode(int size,
Supplier<Random> rand) |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args) |
int |
next() |
void |
reset() |
public SlotCode(int size)
public SlotCode(int size,
Random rand)
public void reset()
public int next()
public static void main(String[] args)
Copyright © 2023. All rights reserved.