Package com.emc.documentum.rest.paging

# Class Paginator<T>

java.lang.Object
com.emc.documentum.rest.paging.Paginator<T>

Type Parameters:
  `T` - the object class in the page

public class Paginator<T> extends Object
A class to paginate items based on the page size.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Paginator(List<T> items, Integer total)`
  Construct a paginator for paging.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Page<T>`
  `paginate(int page, int itemsPerPage)`
  Skip "offset" length of items and paginate the item collection according to "limit" and return the current page

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Paginator

    public Paginator(List<T> items, Integer total)
    Construct a paginator for paging.
    Parameters:
      `items` - a collection of items to be paginated, which is possible only a subset of all items
      `total` - the total number of items, which may be larger than the size of items to be paginated. total is null means total is unknown currently.

- ## Method Details

  - ### paginate

    public Page<T> paginate(int page, int itemsPerPage)
    Skip "offset" length of items and paginate the item collection according to "limit" and return the current page
    Parameters:
      `page` - the page number
      `itemsPerPage` - the number of items per page
    Returns:
      a Page object containing the items in this page and the paging URIs