Class PagingLoader<C extends PagingLoadConfig,​D extends PagingLoadResult<?>>

    • Constructor Detail

      • PagingLoader

        public PagingLoader​(DataProxy<C,​D> proxy)
        Creates a new paging loader instance.
        Parameters:
        proxy - the data proxy
      • PagingLoader

        public PagingLoader​(DataProxy<C,​T> proxy,
                            DataReader<D,​T> reader)
        Creates a new paging loader instance.
        Type Parameters:
        T - the type of data being proxied
        Parameters:
        proxy - the data proxy
        reader - the data reader
    • Method Detail

      • getLimit

        public int getLimit()
        Returns the current limit.
        Returns:
        the current limit
      • getOffset

        public int getOffset()
        Returns the offset of the first record.
        Returns:
        the current offset
      • getTotalCount

        public int getTotalCount()
        Returns the total number of models in the dataset as returned by the server.
        Returns:
        the number of models as passed from the server
      • load

        public void load​(int offset,
                         int limit)
        Loads the data using the specified configuration.
        Parameters:
        offset - the offset of the first record to return
        limit - the page size
      • setLimit

        public void setLimit​(int limit)
        Sets the limit size.
        Parameters:
        limit - the limit
      • setOffset

        public void setOffset​(int offset)
        Sets the offset.
        Parameters:
        offset - the offset