Class PairSeq.Cursor

java.lang.Object
zeroecho.core.marshal.PairSeq.Cursor
Enclosing class:
PairSeq

public final class PairSeq.Cursor extends Object
Forward-only iterator over the pairs of a PairSeq.

The cursor maintains a current index; call next() to advance, then key() and value() to access elements.

Since:
1.0
  • Constructor Details

    • Cursor

      public Cursor()
      Creates a cursor positioned before the first pair in the enclosing sequence.
  • Method Details

    • next

      public boolean next()
      Advances to the next pair if available.
      Returns:
      true if advanced to a valid pair, false if end reached
    • key

      public String key()
      Returns the current key.
      Returns:
      key string
      Throws:
      IndexOutOfBoundsException - if not positioned on a valid pair
    • value

      public String value()
      Returns the current value.
      Returns:
      value string
      Throws:
      IndexOutOfBoundsException - if not positioned on a valid pair