Interface TimeAndDimsIterator

All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
RowIterator, TransformableRowIterator
All Known Implementing Classes:
ForwardingRowIterator

public interface TimeAndDimsIterator extends Closeable
TimeAndDimsIterator (in conjunction with TimeAndDimsPointer) is an Iterator-like abstraction, designed for allocation-free transformation, merging, combining and iteration over a stream of data points. Usage pattern: try (TimeAndDimsIterator iterator = obtainNewTimeAndDimsIteratorFromSomewhere()) { while (iterator.moveToNext()) { TimeAndDimsPointer pointer = iterator.getPointer(); doSomethingWithPointer(pointer); } }
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes any resources, associated with this iterator.
    Returns a pointer to the current data point.
    boolean
    Moves iterator to the next data point.
  • Method Details

    • moveToNext

      boolean moveToNext()
      Moves iterator to the next data point. This method must be called before the first use of getPointer(). As long as this method returns true, getPointer() could be safely called; after this method returned false, this iterator is done, getPointer() must _not_ be called, and close() should be called.
    • getPointer

      TimeAndDimsPointer getPointer()
      Returns a pointer to the current data point. This method may return the same (in terms of referencial identity), as well as different object on any calls, but the data point itself, to which the returned object points, changes after each moveToNext() call that returns {@link true}. This method must not be called before ever calling to moveToNext(). After a call to moveToNext() returned false, the behaviour of this method is undefined (it may return a "wrong" pointer, null, throw an exception, etc.)
    • close

      void close()
      Closes any resources, associated with this iterator.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable