public class RandomRatio<T> extends Object
| 限定符和类型 | 类和说明 |
|---|---|
protected static class |
RandomRatio.Boundary<V>
拥有上下界的一个范围
|
| 构造器和说明 |
|---|
RandomRatio() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addRatio(int ratio,
T value) |
void |
clearRatio() |
void |
forEach(Consumer<T> action) |
int |
getBoundaryCount() |
T |
getByBoundary(long boundaryNumber) |
T |
getByIndex(int index) |
T |
getByRandom() |
T |
getFirst() |
T |
getLast() |
boolean |
isEmpty() |
public void clearRatio()
public void addRatio(int ratio,
T value)
public T getByBoundary(long boundaryNumber)
public T getByIndex(int index)
public T getLast()
public T getFirst()
public T getByRandom()
public boolean isEmpty()
public int getBoundaryCount()
Copyright © 2022. All rights reserved.