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>
    • Constructor Summary

      Constructors 
      Constructor Description
      WeightedStrings​(java.lang.String valueColumn, java.lang.String weightColumn, java.lang.String... filenames)
      Create a sampler of strings from the given CSV file.
    • 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 valueColumn,
                               java.lang.String weightColumn,
                               java.lang.String... filenames)
        Create a sampler of strings from the given CSV file. The CSV file must have plain CSV headers as its first line.
        Parameters:
        valueColumn - The name of the value column to be sampled
        weightColumn - The name of the weight column, which must be parsable as a double
        filenames - One or more file names which will be read in to the sampler buffer
    • Method Detail

      • apply

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