Class FOR_SingleElt<T>

java.lang.Object
simula.runtime.FOR_Element
simula.runtime.FOR_SingleElt<T>
Type Parameters:
T - the type of this element
All Implemented Interfaces:
Iterator<Boolean>

public final class FOR_SingleElt<T> extends FOR_Element

For-statement single value element, not text.

		For i:= 
  • Field Details

    • cvar

      final RTS_NAME<T> cvar
      The for-statement control variable.
    • nextValue

      RTS_NAME<T> nextValue
      Next value.
  • Constructor Details

    • FOR_SingleElt

      public FOR_SingleElt(RTS_NAME<T> cvar, RTS_NAME<T> val)
      Create single value element, not text.
      Parameters:
      cvar - the for-statement control variable
      val - the text value expression
  • Method Details

    • hasNext

      public boolean hasNext()
      Returns true if the iteration has more elements.
      Specified by:
      hasNext in interface Iterator<T>
      Overrides:
      hasNext in class FOR_Element
      Returns:
      true if the iteration has more elements
    • next

      public Boolean next()
      Update the control variable with the next value if any.
      Returns:
      true if the control variable was updated; otherwise false.