java.lang.Object
com.darkcollective.relix.processor.generator.RangeGenerator
All Implemented Interfaces:
Generator

public final class RangeGenerator extends Object implements Generator
Range(lo, hi[, step]) — a finite arithmetic series, the generate_series workhorse. Emits one row per value lo, lo+step, … ≤ hi in a single column n:NUMBER. step defaults to 1; lo > hi yields no rows.

Arguments are integers given as strings: lo and hi are required, step is an optional positive integer.

  • Constructor Details

    • RangeGenerator

      public RangeGenerator()
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface Generator
      Returns:
      the registered generator name (e.g. "Range"); case-insensitive at lookup
    • schema

      public Schema schema(Map<String,String> args)
      Description copied from interface: Generator
      The schema (heading) this generator produces for the given arguments. Implementations should keep this total where possible — argument validation that only affects the rows belongs in Generator.rows(java.util.Map<java.lang.String, java.lang.String>, com.darkcollective.relix.symbol.Schema).
      Specified by:
      schema in interface Generator
      Parameters:
      args - the raw generator arguments
      Returns:
      the output schema
    • rows

      public Stream<Row> rows(Map<String,String> args, Schema schema)
      Description copied from interface: Generator
      Lazily produces the generator's rows.
      Specified by:
      rows in interface Generator
      Parameters:
      args - the raw generator arguments (e.g. lo/hi/step)
      schema - the schema returned by Generator.schema(Map) for the same args
      Returns:
      a lazy stream of rows; the caller closes it
    • cardinality

      public OptionalLong cardinality(Map<String,String> args)
      Description copied from interface: Generator
      The generator's exact cardinality for the given arguments, when known — fed to the cost model as an exact row count (a finite generator like Range knows it precisely). Returns OptionalLong.empty() when unknown or unbounded; the default is empty.
      Specified by:
      cardinality in interface Generator
      Parameters:
      args - the raw generator arguments
      Returns:
      the exact row count, or empty when unknown/unbounded
    • duplicateFree

      public boolean duplicateFree()
      Description copied from interface: Generator
      Whether this generator is inherently duplicate-free (every row distinct). Read by GeneratorDistinctnessSource, which feeds distinctness-driven δ elimination (DIST-001).
      Specified by:
      duplicateFree in interface Generator
      Returns:
      true if the generator never emits a duplicate row