Class SequenceOf
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_int.SequenceOf
- All Implemented Interfaces:
LongToIntFunction
SequenceOf bindings allow you to specify an order and count of a set of values which will then
be repeated in that order.
-
Constructor Summary
ConstructorsConstructorDescriptionSequenceOf(int ignored, String spec) This function produces values from a lookup table for direct control of numerical sequences. -
Method Summary
Modifier and TypeMethodDescriptionintapplyAsInt(long value) static int[]parseSequence(String input)
-
Constructor Details
-
SequenceOf
This function produces values from a lookup table for direct control of numerical sequences. The sequence spec is a string containing the sequence values and their occurences, defaulting to 1 each. Example: "1:6 2 3 4 5", which means "1 at a relative frequency of 6 and 2, 3, 4, and 5 at a relative frequency of 1 each. This will yield pattern "1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, ..."
Each implementation of
SequenceOfmust include a type sigil as the first parameter to disambiguate it from the others.- Parameters:
ignored- any long value, discarded after signature matching. The exampleValue is thrown away, but is necessary for matching the right version of SequenceOf.spec- A string of numbers separated by spaces, semicolons, or commas. This is the sequence spec..
-
-
Method Details
-
parseSequence
-
applyAsInt
public int applyAsInt(long value) - Specified by:
applyAsIntin interfaceLongToIntFunction
-