Class WeightedStrings

  • All Implemented Interfaces:
    java.util.function.LongFunction<java.lang.String>

    public class WeightedStrings
    extends java.lang.Object
    implements java.util.function.LongFunction<java.lang.String>
    Allows for weighted elements to be used, such as a:0.25;b:0.25;c:0.5 or a:1;b:1.0;c:2.0 The unit weights are normalized to the cumulative sum internally, so it is not necessary for them to add up to any particular value.
    • Constructor Summary

      Constructors 
      Constructor Description
      WeightedStrings​(java.lang.String valuesAndWeights)  
    • Method Summary

      Modifier and Type Method Description
      java.lang.String apply​(long value)  
      • Methods inherited from class java.lang.Object

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

      • WeightedStrings

        public WeightedStrings​(java.lang.String valuesAndWeights)
    • Method Detail

      • apply

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