Class WeightedList<E>

java.lang.Object
dev.wyck.util.WeightedList<E>

@NullMarked @AsOf("2.3.0") public final class WeightedList<E> extends Object
A simple weighted random list.

Below FLAT_THRESHOLD total weight it uses a flat lookup array (O(1) draw, memory proportional to total weight); at or above it, a linear scan (O(n) draw, O(n) memory).