Class CoinFunc
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_object.CoinFunc
This is a higher-order function which takes an input value,
and flips a coin. The first parameter is used as the threshold
for choosing a function. If the sample values derived from the
input is lower than the threshold value, then the first following
function is used, and otherwise the second is used.
For example, if the threshold is 0.23, and the input value is
hashed and sampled in the unit interval to 0.43, then the second
of the two provided functions will be used.
The input value does not need to be hashed beforehand, since the
user may need to use the full input value before hashing as the
input to one or both of the functions.
This function will accept either a LongFunction or a
Function
or a LongUnaryOperator in either position. If necessary, use
ToLongFunction to adapt other function forms to be
compatible with these signatures.-
Constructor Details
-
CoinFunc
-
-
Method Details
-
apply
-