Package org.exoplatform.commons.utils
Class AbstractSerializablePageList<E>
java.lang.Object
org.exoplatform.commons.utils.PageList<E>
org.exoplatform.commons.utils.AbstractSerializablePageList<E>
- Direct Known Subclasses:
EmptySerializablePageList,PageListAccess,StatelessPageList
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.
-
Field Summary
Fields inherited from class org.exoplatform.commons.utils.PageList
available_, availablePage_, currentListPage_, currentPage_, EMPTY_LIST -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedThis constructor should not be used by subclasses, it is only for serialization needs.protectedAbstractSerializablePageList(int pageSize) Builds a page list. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidcheckAndSetPage(int page) protected abstract org.exoplatform.commons.utils.ListAccess<E> connect()getAll()final intfinal intfinal intfinal intgetFrom()getPage(int page) final intfinal intgetTo()protected final voidpopulateCurrentPage(int page) protected final voidprotected final voidsetAvailablePage(int available) final voidsetPageSize(int pageSize) protected final void
-
Constructor Details
-
AbstractSerializablePageList
protected AbstractSerializablePageList(int pageSize) Builds a page list.- Parameters:
pageSize- the page size
-
AbstractSerializablePageList
protected AbstractSerializablePageList()This constructor should not be used by subclasses, it is only for serialization needs.
-
-
Method Details
-
connect
- Throws:
Exception
-
populateCurrentPage
-
getAll
- Specified by:
getAllin classorg.exoplatform.commons.utils.PageList<E>
-
writeState
- Throws:
IOException
-
readState
- Throws:
IOException
-
getAvailablePage
public final int getAvailablePage()- Overrides:
getAvailablePagein classorg.exoplatform.commons.utils.PageList<E>
-
getTo
public final int getTo()- Overrides:
getToin classorg.exoplatform.commons.utils.PageList<E>
-
getFrom
public final int getFrom()- Overrides:
getFromin classorg.exoplatform.commons.utils.PageList<E>
-
setAvailablePage
protected final void setAvailablePage(int available) - Overrides:
setAvailablePagein classorg.exoplatform.commons.utils.PageList<E>
-
checkAndSetPage
-
getPage
-
currentPage
-
getAvailable
public final int getAvailable()- Overrides:
getAvailablein classorg.exoplatform.commons.utils.PageList<E>
-
getCurrentPage
public final int getCurrentPage()- Overrides:
getCurrentPagein classorg.exoplatform.commons.utils.PageList<E>
-
setPageSize
public final void setPageSize(int pageSize) - Overrides:
setPageSizein classorg.exoplatform.commons.utils.PageList<E>
-
getPageSize
public final int getPageSize()- Overrides:
getPageSizein classorg.exoplatform.commons.utils.PageList<E>
-