Class WeightedLongs
- java.lang.Object
-
- io.virtdata.libbasics.shared.from_long.to_long.WeightedLongs
-
- All Implemented Interfaces:
java.util.function.LongFunction<java.lang.Long>
public class WeightedLongs extends java.lang.Object implements java.util.function.LongFunction<java.lang.Long>Provides a long value from a list of weighted values. The total likelihood of any value to be produced is proportional to its relative weight in the total weight of all elements. This function automatically hashes the input, so the result is already pseudo-random.
-
-
Constructor Summary
Constructors Constructor Description WeightedLongs(java.lang.String valuesAndWeights)
-
Method Summary
Modifier and Type Method Description java.lang.Longapply(long value)
-