Class PagedArrayList<T>

    • Constructor Detail

      • PagedArrayList

        public PagedArrayList​(KeysetPage keyset,
                              long totalSize,
                              int firstResult,
                              int maxResults)
        Constructs a new empty paged array list.
        Parameters:
        keyset - The keyset page for this page
        totalSize - The total size of the result
        firstResult - The first result index within the overall result
        maxResults - The maximum result count for a page
      • PagedArrayList

        public PagedArrayList​(Collection<? extends T> collection,
                              KeysetPage keyset,
                              long totalSize,
                              int firstResult,
                              int maxResults)
        Constructs a new paged array list from the given collection.
        Parameters:
        collection - The collection of elements for this page
        keyset - The keyset page for this page
        totalSize - The total size of the result
        firstResult - The first result index within the overall result
        maxResults - The maximum result count for a page
    • Method Detail

      • getSize

        public int getSize()
        Description copied from interface: PagedList
        Returns the actual size of this page.
        Specified by:
        getSize in interface PagedList<T>
        Returns:
        The actual size
        See Also:
        List.size()
      • getPage

        public int getPage()
        Description copied from interface: PagedList
        Returns the number of this page, numbered from 1.
        Specified by:
        getPage in interface PagedList<T>
        Returns:
        The number of this page
      • getTotalPages

        public int getTotalPages()
        Description copied from interface: PagedList
        Returns the number of total pages.
        Specified by:
        getTotalPages in interface PagedList<T>
        Returns:
        The number of total pages
      • getFirstResult

        public int getFirstResult()
        Description copied from interface: PagedList
        Returns the position of the first result, numbered from 0. This is the position which was actually queried. This value might be different from KeysetPage.getFirstResult(). If this list was queried with an entity id which does not exist, this will return -1;
        Specified by:
        getFirstResult in interface PagedList<T>
        Returns:
        The position of the first result or -1 if the queried entity id does not exist
      • getMaxResults

        public int getMaxResults()
        Description copied from interface: PagedList
        Returns the maximum number of results. This is the maximum number which was actually queried. This value might be different from KeysetPage.getFirstResult().
        Specified by:
        getMaxResults in interface PagedList<T>
        Returns:
        The maximum number of results