Class WeightedStrings
- java.lang.Object
-
- io.virtdata.libbasics.shared.distributions.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.Stringapply(long value)
-
-
-
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 sampledweightColumn- The name of the weight column, which must be parsable as a doublefilenames- One or more file names which will be read in to the sampler buffer
-
-