Class SequenceOf
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_long.SequenceOf
- All Implemented Interfaces:
LongUnaryOperator
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(long ignored, String spec) This function produces values from a lookup table for direct control of numerical sequences. -
Method Summary
Modifier and TypeMethodDescriptionlongapplyAsLong(long operand) static long[]parseSequence(String input) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.LongUnaryOperator
andThen, compose
-
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
-
applyAsLong
public long applyAsLong(long operand) - Specified by:
applyAsLongin interfaceLongUnaryOperator
-