com.atlassian.confluence.pages
Class ManualTotalPaginationSupport<T>

java.lang.Object
  extended by bucket.core.actions.PaginationSupport<T>
      extended by com.atlassian.confluence.pages.ManualTotalPaginationSupport<T>
All Implemented Interfaces:
PaginationSupport<T>

public class ManualTotalPaginationSupport<T>
extends PaginationSupport<T>

This class allows us to set the total number of items without reading the size of the items list. This means we don't have to load all the items to determine the size.


Field Summary
 
Fields inherited from class bucket.core.actions.PaginationSupport
DEFAULT_COUNT_ON_EACH_PAGE, DEFAULT_PAGE_SIZE
 
Constructor Summary
ManualTotalPaginationSupport()
           
ManualTotalPaginationSupport(int pageSize)
           
ManualTotalPaginationSupport(List<T> items, int startIndex, int total, int pageSize)
           
 
Method Summary
 List<T> getPage()
          Returns a subset of the list of items passed in, based on startIndex and the page size
 int getTotal()
          Returns the total number of items in the list
 void setTotal(int total)
           
 
Methods inherited from class bucket.core.actions.PaginationSupport
getCountOnEachPage, getEndIndex, getItems, getNextIndex, getNextStartIndex, getNextStartIndexes, getNiceEndIndex, getNiceStartIndex, getPageSize, getPreviousIndex, getPreviousStartIndex, getPreviousStartIndexes, getStartIndex, getStartIndexValue, setItems, setPageSize, setStartIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManualTotalPaginationSupport

public ManualTotalPaginationSupport()

ManualTotalPaginationSupport

public ManualTotalPaginationSupport(int pageSize)

ManualTotalPaginationSupport

public ManualTotalPaginationSupport(List<T> items,
                                    int startIndex,
                                    int total,
                                    int pageSize)
Method Detail

getPage

public List<T> getPage()
Description copied from class: PaginationSupport
Returns a subset of the list of items passed in, based on startIndex and the page size

Specified by:
getPage in interface PaginationSupport<T>
Overrides:
getPage in class PaginationSupport<T>
Returns:
a subset of the list of items passed in, based on startIndex and the page size

getTotal

public int getTotal()
Description copied from interface: PaginationSupport
Returns the total number of items in the list

Specified by:
getTotal in interface PaginationSupport<T>
Overrides:
getTotal in class PaginationSupport<T>
Returns:
total number of items in the list

setTotal

public void setTotal(int total)
Overrides:
setTotal in class PaginationSupport<T>


Copyright © 2003–2015 Atlassian. All rights reserved.