| 程序包 | 说明 |
|---|---|
| com.github.jarvisframework.tool.core.lang | |
| com.github.jarvisframework.tool.core.util |
| 限定符和类型 | 方法和说明 |
|---|---|
WeightRandom<T> |
WeightRandom.add(T obj,
double weight)
增加对象
|
WeightRandom<T> |
WeightRandom.add(WeightRandom.WeightObj<T> weightObj)
增加对象权重
|
WeightRandom<T> |
WeightRandom.clear()
清空权重表
|
static <T> WeightRandom<T> |
WeightRandom.create()
创建权重随机获取器
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> WeightRandom<T> |
RandomUtils.weightRandom(Iterable<WeightRandom.WeightObj<T>> weightObjs)
带有权重的随机生成器
|
static <T> WeightRandom<T> |
RandomUtils.weightRandom(WeightRandom.WeightObj<T>[] weightObjs)
带有权重的随机生成器
|
Copyright © 2020. All rights reserved.