public class WeightedPicker extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WeightedPicker.Entry |
Constructor and Description |
---|
WeightedPicker() |
Modifier and Type | Method and Description |
---|---|
static <T extends WeightedPicker.Entry> |
getAt(List<T> list,
int weightMark) |
static <T extends WeightedPicker.Entry> |
getRandom(Random random,
List<T> list) |
static <T extends WeightedPicker.Entry> |
getRandom(Random random,
List<T> list,
int weightSum) |
static int |
getWeightSum(List<? extends WeightedPicker.Entry> list) |
public static int getWeightSum(List<? extends WeightedPicker.Entry> list)
public static <T extends WeightedPicker.Entry> T getRandom(Random random, List<T> list, int weightSum)
public static <T extends WeightedPicker.Entry> T getAt(List<T> list, int weightMark)
public static <T extends WeightedPicker.Entry> T getRandom(Random random, List<T> list)