- All Implemented Interfaces:
Serializable,Cloneable,Iterable<HalData>,Collection<HalData>,List<HalData>,RandomAccess,HalDataPage
Implementation of the
HalDataPage interface.- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCountFields inherited from interface org.refcodes.hal.HalDataPage
PAGE_COUNT, PAGE_NUMBER, PAGE_SIZE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for usage by sub-classes.HalDataPageImpl(int aPageNumber, int aPageSize, int aPageCount) Constructs theHalDataPageinstances with the given pagination metrics. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the total number of the pages which are available for retrieval.intReturns the number of the page which thisHalDataPageinstances represents.intReturns the maximum size of the page being requested for theHalDataPageresult set.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, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods 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
-
Constructor Details
-
HalDataPageImpl
protected HalDataPageImpl()Default constructor for usage by sub-classes. -
HalDataPageImpl
public HalDataPageImpl(int aPageNumber, int aPageSize, int aPageCount) Constructs theHalDataPageinstances with the given pagination metrics.- Parameters:
aPageNumber- The page's number as of pagination.aPageSize- The page's size as of pagination.aPageCount- The total page count of the overall result set.
-
-
Method Details
-
getPageNumber
public int getPageNumber()Returns the number of the page which thisHalDataPageinstances represents.- Specified by:
getPageNumberin interfaceHalDataPage- Returns:
- The
HalDataPageresult set's page number as of pagination.
-
getPageSize
public int getPageSize()Returns the maximum size of the page being requested for theHalDataPageresult set. Returns -1 in case no page size has been specified.- Specified by:
getPageSizein interfaceHalDataPage- Returns:
- The
HalDataPageresult set's page size as of pagination.
-
getPageCount
public int getPageCount()Returns the total number of the pages which are available for retrieval.- Specified by:
getPageCountin interfaceHalDataPage- Returns:
- The total number of the pages repesenting the overall result set..
-