Package com.blazebit.persistence
Interface PagedList<T>
- Type Parameters:
T
- the type of elements in this list
- All Superinterfaces:
Collection<T>
,Iterable<T>
,List<T>
- All Known Implementing Classes:
PagedArrayList
public interface PagedList<T> extends List<T>
An extended version of a List which also provides access to the total size of the list.
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Field Summary
-
Method Summary
Modifier and Type Method Description int
getFirstResult()
Returns the position of the first result, numbered from 0.KeysetPage
getKeysetPage()
Returns the key set page for this paged list which can be used for key set pagination.int
getMaxResults()
Returns the maximum number of results.int
getPage()
Returns the number of this page, numbered from 1.int
getSize()
Returns the actual size of this page.int
getTotalPages()
Returns the number of total pages.long
getTotalSize()
Returns the total size of the list or-1
if the count query was disabled viaPaginatedCriteriaBuilder.withCountQuery(boolean)
.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 Details
-
EMPTY
An empty paged list.- Since:
- 1.2.0
-
-
Method Details
-
getSize
int getSize()Returns the actual size of this page.- Returns:
- The actual size
- See Also:
List.size()
-
getTotalSize
long getTotalSize()Returns the total size of the list or-1
if the count query was disabled viaPaginatedCriteriaBuilder.withCountQuery(boolean)
.- Returns:
- The total size or
-1
if the count query was disabled
-
getPage
int getPage()Returns the number of this page, numbered from 1.- Returns:
- The number of this page
-
getTotalPages
int getTotalPages()Returns the number of total pages.- Returns:
- The number of total pages
-
getFirstResult
int getFirstResult()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
;- Returns:
- The position of the first result or
-1
if the queried entity id does not exist
-
getMaxResults
int getMaxResults()Returns the maximum number of results. This is the maximum number which was actually queried. This value might be different from KeysetPage.getFirstResult().- Returns:
- The maximum number of results
-
getKeysetPage
KeysetPage getKeysetPage()Returns the key set page for this paged list which can be used for key set pagination. The key set page may be null if key set pagination wasn't used.- Returns:
- The key set
- See Also:
FullQueryBuilder.page(com.blazebit.persistence.KeysetPage, int, int)
-