Class AbstractListAccess<E>
java.lang.Object
org.exoplatform.forum.common.utils.AbstractListAccess<E>
- All Implemented Interfaces:
org.exoplatform.commons.utils.ListAccess<E>
- Direct Known Subclasses:
UserListAccess
public abstract class AbstractListAccess<E>
extends Object
implements org.exoplatform.commons.utils.ListAccess<E>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the currentPage of page list accessintgetFrom()Get fromIndex of pageintGet current offsetintgetOffset(int page) Get the offset by pageintGet the page size of page list accessintgetTo()Get toIndex of pageintGet total page of page list accessvoidinitialize(int pageSize, int pageSelect) Initialize page list accessabstract E[]load(int pageSelect) voidreCalculate(int offset, int limit) Re-calculate the value of currentPagevoidsetCurrentPage(int page) Set the currentPage of page list accessvoidsetPageSize(int pageSize) Set the page size of page list accessMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.exoplatform.commons.utils.ListAccess
getSize, load
-
Field Details
-
size
protected int size
-
-
Constructor Details
-
AbstractListAccess
public AbstractListAccess()
-
-
Method Details
-
load
- Throws:
ExceptionIllegalArgumentException
-
reCalculate
public void reCalculate(int offset, int limit) Re-calculate the value of currentPage- Parameters:
offset-limit-
-
initialize
Initialize page list access- Parameters:
pageSize-pageSelect-- Throws:
Exception
-
getTotalPages
Get total page of page list access- Returns:
- Throws:
Exception
-
getPageSize
public int getPageSize()Get the page size of page list access- Returns:
-
setPageSize
public void setPageSize(int pageSize) Set the page size of page list access- Parameters:
pageSize-
-
getCurrentPage
public int getCurrentPage()Get the currentPage of page list access- Returns:
-
setCurrentPage
public void setCurrentPage(int page) Set the currentPage of page list access- Parameters:
page-
-
getOffset
public int getOffset(int page) Get the offset by page- Parameters:
page-- Returns:
-
getOffset
public int getOffset()Get current offset- Returns:
-
getFrom
public int getFrom()Get fromIndex of page- Returns:
-
getTo
public int getTo()Get toIndex of page- Returns:
-