public abstract class AbstractSerializablePageList<E>
extends org.exoplatform.commons.utils.PageList<E>
This class defines the common functionalities for the serializable subclasses of PageList. Note that itself it does
not implement the Serializable interface for the reason that it needs to define a no arg constructor in a non
serializble class (serialization constraint).
The method defines an abstract connect() method that is used to connect the the page list to the underlying data.
The methods readState(java.io.ObjectInputStream) and writeState(java.io.ObjectOutputStream) are defined for
the subclasses and should be called by void readObject(ObjectInputStream in) and
void writeObject(ObjectOutputStream out) custom serialization protocol.
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSerializablePageList()
This constructor should not be used by subclasses, it is only for serialization needs.
|
protected |
AbstractSerializablePageList(int pageSize)
Builds a page list.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkAndSetPage(int page) |
protected abstract org.exoplatform.commons.utils.ListAccess<E> |
connect() |
List<E> |
currentPage() |
List<E> |
getAll() |
int |
getAvailable() |
int |
getAvailablePage() |
int |
getCurrentPage() |
int |
getFrom() |
List<E> |
getPage(int page) |
int |
getPageSize() |
int |
getTo() |
protected void |
populateCurrentPage(int page) |
protected void |
readState(ObjectInputStream in) |
protected void |
setAvailablePage(int available) |
void |
setPageSize(int pageSize) |
protected void |
writeState(ObjectOutputStream out) |
protected AbstractSerializablePageList(int pageSize)
pageSize - the page sizeprotected AbstractSerializablePageList()
protected abstract org.exoplatform.commons.utils.ListAccess<E> connect() throws Exception
Exceptionprotected final void populateCurrentPage(int page)
throws Exception
public final List<E> getAll()
getAll in class org.exoplatform.commons.utils.PageList<E>protected final void writeState(ObjectOutputStream out) throws IOException
IOExceptionprotected final void readState(ObjectInputStream in) throws IOException
IOExceptionpublic final int getAvailablePage()
getAvailablePage in class org.exoplatform.commons.utils.PageList<E>public final int getTo()
getTo in class org.exoplatform.commons.utils.PageList<E>public final int getFrom()
getFrom in class org.exoplatform.commons.utils.PageList<E>protected final void setAvailablePage(int available)
setAvailablePage in class org.exoplatform.commons.utils.PageList<E>protected final void checkAndSetPage(int page)
throws Exception
public final int getAvailable()
getAvailable in class org.exoplatform.commons.utils.PageList<E>public final int getCurrentPage()
getCurrentPage in class org.exoplatform.commons.utils.PageList<E>public final void setPageSize(int pageSize)
setPageSize in class org.exoplatform.commons.utils.PageList<E>public final int getPageSize()
getPageSize in class org.exoplatform.commons.utils.PageList<E>Copyright © 2017 JBoss by Red Hat. All Rights Reserved.