Class ListBufferCalls

java.lang.Object
org.ek9lang.compiler.phase7.support.ListBufferCalls

public final class ListBufferCalls extends Object
THE call shapes for the raw org.ek9.lang::List buffer that stream pipeline staging drains into - use these, do not hand-roll a fourth variant.

A buffering stage (SORT, GROUP, SPLIT, TAIL, JOIN, ASYNC) cannot emit downstream until it has seen the whole stream, so the pipeline materialises into a buffer and then iterates it. That buffer is always the RAW List - never the parameterised wrapper - because a pre-built type such as List of String would need private delegate-field access. Three shapes make up the whole protocol, and every buffering stage uses all three in the same order:

  1. create() - new org.ek9.lang::List()
  2. keep(String, String) - buffer._addAss(item) once per drained element, for the buffer of a stage: a stage never drops an unset element (KeepsUnsetElements, true for every buffering stage; append(int, String, String) asks it), or pipe(String, String) - buffer._pipe(item), which drops an unset value - only where the drained value can never be unset (a group/split bucket)
  3. iterate(String) - buffer.iterator() to emit downstream

The call metadata is owned here rather than passed in: these are all the same three calls on the same type, so their metadata is by definition identical and belongs in one place.

  • Constructor Details

  • Method Details

    • create

      public CallDetails create()
      new org.ek9.lang::List() - an empty raw buffer typed as the List itself.
    • create

      public CallDetails create(String returnTypeName)
      new org.ek9.lang::List() where the buffer is immediately viewed as returnTypeName - used where the drain target is declared at the collection type the stage produces rather than at the raw List.
    • pipe

      public CallDetails pipe(String bufferVar, String itemVar)
      buffer._pipe(item) - append one drained element. Takes Any because the buffer is raw, and returns Void.
    • keep

      public CallDetails keep(String bufferVar, String itemVar)
      buffer._addAss(item) - append one drained element AS IT IS, unset or not: += stores what it is given, where | drops an unset value. For the buffer of a stage: a stage never drops an unset element (Steve, 2026-10-21; D24: a sort places them after every group). A TERMINAL into a List appends the same way (KeepsUnsetIntoList, emitted by AbstractStreamStageGenerator.generateTerminalPipe against the parameterised List itself, not this raw buffer).
    • append

      public CallDetails append(int bufferStageOp, String bufferVar, String itemVar)
      THE append for the buffer of a stage: keep(String, String) when the stage keeps unset elements (KeepsUnsetElements), otherwise pipe(String, String).
    • iterate

      public CallDetails iterate(String bufferVar)
      buffer.iterator() - iterate the drained buffer to emit downstream.