Class RangeIterator.ArrayBacked

java.lang.Object
io.deephaven.engine.rowset.impl.rsp.container.RangeIterator.ArrayBacked
All Implemented Interfaces:
RangeIterator
Enclosing interface:
RangeIterator

public static class RangeIterator.ArrayBacked extends Object implements RangeIterator
  • Constructor Details

    • ArrayBacked

      public ArrayBacked(int[] ranges)
  • Method Details

    • copy

    • hasNext

      public boolean hasNext()
      Description copied from interface: RangeIterator
      Checks if the iterator has more ranges. If hasNext() returns false, calling next thereafter results in undefined behavior.
      Specified by:
      hasNext in interface RangeIterator
      Returns:
      whether there is another range.
    • start

      public int start()
      Description copied from interface: RangeIterator
      Start of the current range.

      Calling start() without calling next() at least once results in undefined behavior.

      Specified by:
      start in interface RangeIterator
      Returns:
      the start of the current range.
    • end

      public int end()
      Description copied from interface: RangeIterator
      End of the current range (exclusive).

      Calling end() without calling next() at least once results in undefined behavior.

      Specified by:
      end in interface RangeIterator
      Returns:
      the end of the current range (exclusive).
    • next

      public void next()
      Description copied from interface: RangeIterator
      Advance the iterator to the next range. Only call after hasNext() has returned true.
      Specified by:
      next in interface RangeIterator
    • next

      public int next(short[] buffer, int offset, int maxShortCount)
      Description copied from interface: RangeIterator
      Get the next batch of ranges.
      Specified by:
      next in interface RangeIterator
      Parameters:
      buffer - a short array where consecutive pairs of (start, end-1) values will be stored.
      offset - where in buffer to start storing range boundary values.
      maxShortCount - maximum number of ranges that can be written to buffer; buffer should have at least space for 2*maxRanges shorts starting at offset.
      Returns:
      how many ranges were written in buffer; this is two times the individual elements written.