Class RangeResultObjectProvider

  • All Implemented Interfaces:
    ResultObjectProvider, Closeable

    public class RangeResultObjectProvider
    extends java.lang.Object
    implements ResultObjectProvider
    Prevents a view of a given range of indices from the delegate result object provider.
    Author:
    Abe White
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean absolute​(int pos)
      Move to the given 0-based position.
      void close()
      Free the resources associated with this provider.
      ResultObjectProvider getDelegate()  
      java.lang.Object getResultObject()
      Instantiate the current result object.
      void handleCheckedException​(java.lang.Exception e)
      Any checked exceptions that are thrown will be passed to this method.
      boolean next()
      Advance the input to the next position.
      void open()
      Open the result.
      void reset()
      Reset this provider.
      int size()
      Return the number of items in the input, or Integer.MAX_VALUE if the size in unknown.
      boolean supportsRandomAccess()
      Return true if this provider supports random access.
      • Methods inherited from class java.lang.Object

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

      • RangeResultObjectProvider

        public RangeResultObjectProvider​(ResultObjectProvider delegate,
                                         long startIdx,
                                         long endIdx)
        Constructor. Because this is a wrapper around some delegate, and result object providers work with int indexes, neither the start or end index can be greater than Integer.MAX_VALUE(with the exception of Long.MAX_VALUE, which is used to indicate no limit).
        Parameters:
        delegate - the result object provider to delegate to
        startIdx - 0-based inclusive start index of the range to present; must be < Integer.MAX_VALUE
        endIdx - 0-based exclusive end index of the range to present; must be < Integer.MAX_VALUE, or Long.MAX_VALUE for no limit