Package org.codelibs.fess.dict
Class DictionaryFile.PagingList<E>
java.lang.Object
org.codelibs.fess.dict.DictionaryFile.PagingList<E>
- Type Parameters:
E- the type of elements in this list
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>,SequencedCollection<E>
- Enclosing class:
DictionaryFile<T extends DictionaryItem>
A paginated list implementation that wraps another list and provides
pagination metadata and functionality.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe total number of pages available.protected intThe total number of records across all pages.protected intThe current page number (1-based).protected intThe size of the page range for navigation.protected intThe number of records per page. -
Constructor Summary
ConstructorsConstructorDescriptionPagingList(List<E> list, int offset, int size, int allRecordCount) Creates a new PagingList with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends E> c) booleanaddAll(Collection<? extends E> c) voidclear()booleanbooleancontainsAll(Collection<?> c) Creates a list of page numbers for navigation.get(int index) intReturns the total number of pages.intReturns the total number of records across all pages.intReturns the current page number (1-based).intReturns the page size (number of records per page).intbooleanisEmpty()booleanChecks if a next page exists.booleanChecks if a previous page exists.iterator()intlistIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) voidsetPageRangeSize(int pageRangeSize) Sets the page range size for navigation.intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Field Details
-
allPageCount
protected int allPageCountThe total number of pages available. -
allRecordCount
protected int allRecordCountThe total number of records across all pages. -
pageSize
protected int pageSizeThe number of records per page. -
currentPageNumber
protected int currentPageNumberThe current page number (1-based). -
pageRangeSize
protected int pageRangeSizeThe size of the page range for navigation.
-
-
Constructor Details
-
PagingList
Creates a new PagingList with the specified parameters.- Parameters:
list- the underlying list of items for this pageoffset- the starting offset for this pagesize- the page sizeallRecordCount- the total number of records across all pages
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
subList
-
getAllRecordCount
public int getAllRecordCount()Returns the total number of records across all pages.- Returns:
- the total record count
-
getPageSize
public int getPageSize()Returns the page size (number of records per page).- Returns:
- the page size
-
getCurrentPageNumber
public int getCurrentPageNumber()Returns the current page number (1-based).- Returns:
- the current page number
-
getAllPageCount
public int getAllPageCount()Returns the total number of pages.- Returns:
- the total page count
-
isExistPrePage
public boolean isExistPrePage()Checks if a previous page exists.- Returns:
- true if there is a previous page, false otherwise
-
isExistNextPage
public boolean isExistNextPage()Checks if a next page exists.- Returns:
- true if there is a next page, false otherwise
-
setPageRangeSize
public void setPageRangeSize(int pageRangeSize) Sets the page range size for navigation.- Parameters:
pageRangeSize- the page range size to set
-
createPageNumberList
Creates a list of page numbers for navigation.- Returns:
- a list of page numbers within the page range
-