com.ibm.jarm.api.collection

Interface RMPageIterator<T>

  • All Known Subinterfaces:
    CBRPageIterator<T>


    public interface RMPageIterator<T>
    A parameterized paging, read-only iterator interface. This interface is used to page through large collections.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.util.List<T> getCurrentPage()
      Returns the contents of the iterator's current page.
      int getElementCount()
      Indicates the number of elements in the current page.
      RMPageMark getPageMark()
      Returns a PageMark instance representing the iterator's current continuation state.
      int getPageSize()
      Indicates the current maximum page size defined for the RMPageIterator.
      boolean nextPage()
      Moves the iterator to the next page of the collection.
      void reset()
      Positions the page iterator to a point just before the first page of results.
      void reset(RMPageMark mark)
      Resets the page iterator back to the specified set of results as defined by a RMPageMark instance.
      void setPageSize(int pageSize)
      Defines the maximum number of elements for any subsequent getCurrentPage() method calls.
    • Method Detail

      • setPageSize

        void setPageSize(int pageSize)
        Defines the maximum number of elements for any subsequent getCurrentPage() method calls. The page size value established through this method does NOT apply to the first page resulting from the first call to getCurrentPage(). The page size used for the initial getCurrentPage() call is defined by how the collection was originally retrieved (for example, by a "fetch" or "search" mechanism).
        Parameters:
        pageSize - An int value greater than 0.
      • getPageSize

        int getPageSize()
        Indicates the current maximum page size defined for the RMPageIterator.
        Returns:
        An int value.
      • nextPage

        boolean nextPage()
        Moves the iterator to the next page of the collection. This method must initially be called for a newly acquired iterator in order to move the iterator to the first page of the collection.
        Returns:
        true until the iterator reaches the end of the collection. false for the first call of an empty collection.
        Throws:
        RAL_PAGE_ITERATOR_NEXT_PAGE_ERR - for any unexpected error attempting to move to the next page.
      • getElementCount

        int getElementCount()
        Indicates the number of elements in the current page.
        Returns:
        An int value.
        Throws:
        RAL_PAGE_ITERATOR_ELEMENT_COUNT_ERR - for any unexpected error retrieving the current page count.
      • getCurrentPage

        java.util.List<T> getCurrentPage()
        Returns the contents of the iterator's current page.
        Returns:
        A List collection of the parameterized type.
        Throws:
        RAL_PAGE_ITERATOR_CURRENT_PAGE_ERR - for any unexpected error retrieving the current page.
      • getPageMark

        RMPageMark getPageMark()
        Returns a PageMark instance representing the iterator's current continuation state. This parameter can be used in a subsequent reset(RMPageMark) method call.
        Returns:
        A RMPageMark instance.
        Throws:
        RAL_PAGE_ITERATOR_PAGE_MARK_ERROR - for any unexpected error determining the current page mark location.
      • reset

        void reset(RMPageMark mark)
        Resets the page iterator back to the specified set of results as defined by a RMPageMark instance. This reset method positions the iterator before the marked page, the getCurrentPage() method must be called to position the iterator to the marked page.
        Parameters:
        mark - A RMPageMark instance.
      • reset

        void reset()
        Positions the page iterator to a point just before the first page of results. You must first call nextPage() to initially position the iterator to the first page.

© Copyright IBM Corp. 2010, 2013. All Rights Reserved.