Class WeightedLongs

java.lang.Object
io.nosqlbench.virtdata.library.basics.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.Long apply​(long value)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WeightedLongs

      public WeightedLongs​(java.lang.String valuesAndWeights)
  • Method Details

    • apply

      public java.lang.Long apply​(long value)
      Specified by:
      apply in interface java.util.function.LongFunction<java.lang.Long>