Package | Description |
---|---|
cn.hutool.core.lang |
语言特性包,包括大量便捷的数据结构,例如验证器Validator,分布式ID生成器Snowflake等
|
cn.hutool.core.util |
提供各种工具方法,按照归类入口为XXXUtil,如字符串工具StrUtil等
|
Modifier and Type | Method and Description |
---|---|
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()
创建权重随机获取器
|
Modifier and Type | Method and Description |
---|---|
static <T> WeightRandom<T> |
RandomUtil.weightRandom(Iterable<WeightRandom.WeightObj<T>> weightObjs)
带有权重的随机生成器
|
static <T> WeightRandom<T> |
RandomUtil.weightRandom(WeightRandom.WeightObj<T>[] weightObjs)
带有权重的随机生成器
|
Copyright © 2024. All rights reserved.