Class PageableList<R>

  • All Implemented Interfaces:
    IdentifiableSearchQuery, Pageable<R>

    public class PageableList<R>
    extends java.lang.Object
    implements Pageable<R>
    Implementation of Pageable which can be instantiated from List and an integer value indicating the page size.
    • Constructor Detail

      • PageableList

        public PageableList​(java.util.List<R> allResults,
                            int pageSize)
        Creates a new PageableList based on the List and the pageSize.
        Parameters:
        allResults - - List of elements that you want to page.
        pageSize -
      • PageableList

        public PageableList​(java.util.List<R> allResults,
                            int pageSize,
                            java.lang.String typeCode)
      • PageableList

        public PageableList​(PageableList<R> source)
        Copy constructor. Creates deep copy of given PageableList object with shallow copy of allResults list.
        Parameters:
        source - object to copy
    • Method Detail

      • refresh

        public void refresh()
        Description copied from interface: Pageable
        Refreshes current page.
        Specified by:
        refresh in interface Pageable<R>
      • getCurrentPage

        public java.util.List<R> getCurrentPage()
        Description copied from interface: Pageable
        Gets the entries of the current record.
        Specified by:
        getCurrentPage in interface Pageable<R>
        Returns:
        all entries of the current record page
      • hasNextPage

        public boolean hasNextPage()
        Description copied from interface: Pageable
        Determines if there is a next page.
        Specified by:
        hasNextPage in interface Pageable<R>
        Returns:
        boolean
      • hasPreviousPage

        public boolean hasPreviousPage()
        Description copied from interface: Pageable
        Determines if there is a previous page.
        Specified by:
        hasPreviousPage in interface Pageable<R>
        Returns:
        boolean
      • setPageNumber

        public void setPageNumber​(int pageNo)
        Description copied from interface: Pageable
        Sets the active page number.
        Specified by:
        setPageNumber in interface Pageable<R>
      • getPageSize

        public int getPageSize()
        Description copied from interface: Pageable
        Returns the page size.
        Specified by:
        getPageSize in interface Pageable<R>
        Returns:
        integer
      • getTypeCode

        public java.lang.String getTypeCode()
        Description copied from interface: Pageable
        Returns the "common" type code of all entries.
        Specified by:
        getTypeCode in interface Pageable<R>
        Returns:
        the common type code or null if no common type code can be applied
      • setTypeCode

        public void setTypeCode​(java.lang.String typeCode)
      • setPageSize

        public java.util.List<R> setPageSize​(int _pageSize)
        Description copied from interface: Pageable
        Changes the page size and returns the current page with a new page size.
        Specified by:
        setPageSize in interface Pageable<R>
        Parameters:
        _pageSize - - new page size
        Returns:
        List of RESULT or empty list.
      • getTotalCount

        public int getTotalCount()
        Description copied from interface: Pageable
        Returns count of all items in the collection that is being paged.
        Specified by:
        getTotalCount in interface Pageable<R>
        Returns:
        total items count
      • getPageNumber

        public int getPageNumber()
        Description copied from interface: Pageable
        Returns the active page number.
        Specified by:
        getPageNumber in interface Pageable<R>
        Returns:
        the active page number
      • getSortData

        public SortData getSortData()
        Description copied from interface: Pageable
        Returns sort related information
        Specified by:
        getSortData in interface Pageable<R>
        Returns:
        sort related information
      • setSortData

        public void setSortData​(SortData sortData)
        Specified by:
        setSortData in interface Pageable<R>
        Parameters:
        sortData - sort related information
      • getAllResults

        public java.util.List<R> getAllResults()
        Description copied from interface: Pageable
        Returns all results on all pages. May be a long lasting operation for big data sets, therefore should be used carefully.
        Specified by:
        getAllResults in interface Pageable<R>
        Returns:
      • getQueryId

        public java.lang.String getQueryId()
        Specified by:
        getQueryId in interface IdentifiableSearchQuery
        Returns:
        identifier of a query. Queries with same identifiers are assumed to perform same request to data source
      • setQueryId

        public void setQueryId​(java.lang.String queryId)
        Specified by:
        setQueryId in interface Pageable<R>
        Parameters:
        queryId - Queries with same identifiers are assumed to perform same request to data source