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, 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. pipe(String, String) - buffer._pipe(item) once per drained element
  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.
    • iterate

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