Class SequenceOf

java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_long.SequenceOf
All Implemented Interfaces:
LongUnaryOperator

public class SequenceOf extends Object implements 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 Details

    • SequenceOf

      public SequenceOf(long ignored, String spec)

      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 SequenceOf must 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

      public static long[] parseSequence(String input)
    • applyAsLong

      public long applyAsLong(long operand)
      Specified by:
      applyAsLong in interface LongUnaryOperator