Class PaginablePageProvider<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- org.nuxeo.ecm.automation.core.util.PaginablePageProvider<T>
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess,Paginable<T>
- Direct Known Subclasses:
LogEntryList,PaginableDocumentModelListImpl,PaginableRecordSetImpl
public class PaginablePageProvider<T> extends ArrayList<T> implements Paginable<T>
Wraps aPageProvider.- Since:
- 5.7.3
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PageProvider<T>pageProvider-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description PaginablePageProvider(PageProvider<T> pageProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<QuickFilter>getActiveQuickFilters()Map<String,Aggregate<? extends Bucket>>getAggregates()List<QuickFilter>getAvailableQuickFilters()longgetCurrentPageIndex()Returns the current page index as a zero-based integer.longgetCurrentPageOffset()Returns the offset (starting from 0) of the first element in the current page orUNKNOWN_SIZE.longgetCurrentPageSize()Returns the number of elements in current page.StringgetErrorMessage()longgetMaxPageSize()Returns the max number of results per page.longgetNumberOfPages()Returns the total number of pages or 0 if number of pages is unknown.longgetPageSize()Returns the number of results per page.longgetResultsCount()Returns the number of result elements if available or a negative value if it is unknown:UNKNOWN_SIZEif it is unknown as query was not done, and since 5.5,UNKNOWN_SIZE_AFTER_QUERYif it is still unknown after query was done.longgetResultsCountLimit()Limit of number of results beyond which the page provider may not be able to computePaginable.getResultsCount()or navigate.booleanhasAggregateSupport()booleanhasError()booleanisLastPageAvailable()Returns a boolean expressing if the last page can be displayed.booleanisNextPageAvailable()Returns a boolean expressing if there are further pages.booleanisPreviousPageAvailable()Returns a boolean expressing if there is a previous page.booleanisSortable()Returns if this provider is sortable.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Field Detail
-
pageProvider
protected PageProvider<T> pageProvider
-
-
Constructor Detail
-
PaginablePageProvider
public PaginablePageProvider(PageProvider<T> pageProvider)
-
-
Method Detail
-
getPageSize
public long getPageSize()
Description copied from interface:PaginableReturns the number of results per page. 0 means no pagination.- Specified by:
getPageSizein interfacePaginable<T>
-
getMaxPageSize
public long getMaxPageSize()
Description copied from interface:PaginableReturns the max number of results per page. 0 means no pagination.If page size is greater than this maximum value, it will be taken into account instead.
- Specified by:
getMaxPageSizein interfacePaginable<T>
-
getResultsCount
public long getResultsCount()
Description copied from interface:PaginableReturns the number of result elements if available or a negative value if it is unknown:UNKNOWN_SIZEif it is unknown as query was not done, and since 5.5,UNKNOWN_SIZE_AFTER_QUERYif it is still unknown after query was done.- Specified by:
getResultsCountin interfacePaginable<T>
-
getNumberOfPages
public long getNumberOfPages()
Description copied from interface:PaginableReturns the total number of pages or 0 if number of pages is unknown.- Specified by:
getNumberOfPagesin interfacePaginable<T>
-
isNextPageAvailable
public boolean isNextPageAvailable()
Description copied from interface:PaginableReturns a boolean expressing if there are further pages.- Specified by:
isNextPageAvailablein interfacePaginable<T>
-
isLastPageAvailable
public boolean isLastPageAvailable()
Description copied from interface:PaginableReturns a boolean expressing if the last page can be displayed.- Specified by:
isLastPageAvailablein interfacePaginable<T>
-
isPreviousPageAvailable
public boolean isPreviousPageAvailable()
Description copied from interface:PaginableReturns a boolean expressing if there is a previous page.- Specified by:
isPreviousPageAvailablein interfacePaginable<T>
-
getCurrentPageSize
public long getCurrentPageSize()
Description copied from interface:PaginableReturns the number of elements in current page.- Specified by:
getCurrentPageSizein interfacePaginable<T>
-
getCurrentPageIndex
public long getCurrentPageIndex()
Description copied from interface:PaginableReturns the current page index as a zero-based integer.- Specified by:
getCurrentPageIndexin interfacePaginable<T>
-
getCurrentPageOffset
public long getCurrentPageOffset()
Description copied from interface:PaginableReturns the offset (starting from 0) of the first element in the current page orUNKNOWN_SIZE.- Specified by:
getCurrentPageOffsetin interfacePaginable<T>
-
isSortable
public boolean isSortable()
Description copied from interface:PaginableReturns if this provider is sortable.- Specified by:
isSortablein interfacePaginable<T>
-
getErrorMessage
public String getErrorMessage()
- Specified by:
getErrorMessagein interfacePaginable<T>
-
getAggregates
public Map<String,Aggregate<? extends Bucket>> getAggregates()
- Specified by:
getAggregatesin interfacePaginable<T>
-
hasAggregateSupport
public boolean hasAggregateSupport()
- Specified by:
hasAggregateSupportin interfacePaginable<T>
-
getActiveQuickFilters
public List<QuickFilter> getActiveQuickFilters()
- Specified by:
getActiveQuickFiltersin interfacePaginable<T>
-
getAvailableQuickFilters
public List<QuickFilter> getAvailableQuickFilters()
- Specified by:
getAvailableQuickFiltersin interfacePaginable<T>
-
getResultsCountLimit
public long getResultsCountLimit()
Description copied from interface:PaginableLimit of number of results beyond which the page provider may not be able to computePaginable.getResultsCount()or navigate.Requesting results beyond this limit may result in error. When
Paginable.getResultsCount()is negative, it means there may be more results than this limit.0 means there is no limit.
- Specified by:
getResultsCountLimitin interfacePaginable<T>
-
-