Class IteratorCursor<E>

Type Parameters:
E - Element type
All Implemented Interfaces:
AutoCloseable, Cursor
Direct Known Subclasses:
ArrayIteratorCursor, ListIteratorCursor, MapIteratorCursor, RecordIteratorCursor

public abstract class IteratorCursor<E> extends PositionedCursor<E>
Implementation of Cursor on top of an Iterator that returns a record for each row. The returned record is cached to avoid multiple computations of current row.
  • Constructor Details

    • IteratorCursor

      protected IteratorCursor(Iterator<E> iterator)
      Creates an IteratorCursor.
      Parameters:
      iterator - input iterator
  • Method Details

    • next

      public boolean next()
      Description copied from interface: Cursor
      Moves to the next row.
      Specified by:
      next in interface Cursor
      Specified by:
      next in class AbstractCursor
      Returns:
      Whether moved
    • close

      public void close()
      Description copied from interface: Cursor
      Closes this cursor and releases resources.
    • current

      protected E current()
      Description copied from class: PositionedCursor
      Returns the current row.
      Specified by:
      current in class PositionedCursor<E>
      Returns:
      current row