Class HugeCursor<Array>

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public abstract class HugeCursor<Array>
    extends java.lang.Object
    implements java.lang.AutoCloseable
    View of data underlying an Huge array, accessible as slices of one or more primitive arrays. The values are from array[offset] (inclusive) until array[limit] (exclusive). The range might match the complete array, but that isn't guaranteed.

    The limit parameter does not have the same meaning as the length parameter that is used in many methods that can operate on array slices. The proper value would be int length = limit - offset.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      Array array
      a slice of values currently being traversed
      long base
      the base for the index to get the global index
      int limit
      the limit of the array, exclusive – the first index not to be contained
      int offset
      the offset into the array
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract void close()
      Releases the reference to the underlying array so that it might be garbage collected.
      abstract boolean next()
      Try to load the next page and return the success of this load.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • base

        public long base
        the base for the index to get the global index
      • array

        public Array array
        a slice of values currently being traversed
      • offset

        public int offset
        the offset into the array
      • limit

        public int limit
        the limit of the array, exclusive – the first index not to be contained
    • Method Detail

      • next

        public abstract boolean next()
        Try to load the next page and return the success of this load. Once the method returns false, this method will never return true again until the cursor is reset. The cursor behavior is not defined and might be unusable and throw exceptions after this method returns false.
        Returns:
        true, iff the cursor is still valid on contains new data; false if there is no more data.
      • close

        public abstract void close()
        Releases the reference to the underlying array so that it might be garbage collected. The cursor can never be used again after calling this method, doing so results in undefined behavior.
        Specified by:
        close in interface java.lang.AutoCloseable