@ThreadSafe public class SlotCode extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
size |
| Constructor and Description |
|---|
SlotCode(int size)
初始化一个固定容量[1,size]的随机槽
|
SlotCode(int size,
Random rand)
初始化一个固定容量[1,size]的随机槽
|
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)
size - 设置code的最大值(包括)。public SlotCode(int size,
Random rand)
size - 设置code的最大值(包括)。rand - 随机数发生器。public void reset()
public int next()
public static void main(String[] args)
Copyright © 2020. All rights reserved.