org.hyperic.util.pager
Class PageControl
java.lang.Object
org.hyperic.util.pager.PageControl
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class PageControl
- extends java.lang.Object
- implements java.io.Serializable, java.lang.Cloneable
A utility class to wrap up all the paging/sorting options that
are frequently used with finders and other methods that return
lists of things.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
SIZE_UNLIMITED
public static final int SIZE_UNLIMITED
- See Also:
- Constant Field Values
SORT_UNSORTED
public static final int SORT_UNSORTED
- See Also:
- Constant Field Values
SORT_ASC
public static final int SORT_ASC
- See Also:
- Constant Field Values
SORT_DESC
public static final int SORT_DESC
- See Also:
- Constant Field Values
SQL_SORTS
public static final java.lang.String[] SQL_SORTS
- The SQL string representation of the above sort constants
Note that the indices into this array line up with the
constant values above for the SORT_XXX constants.
PAGE_ALL
public static final PageControl PAGE_ALL
PAGE_NONE
public static final PageControl PAGE_NONE
PAGE_MIN
public static final PageControl PAGE_MIN
PageControl
public PageControl()
PageControl
public PageControl(int pagenum,
int pagesize)
PageControl
public PageControl(int pagenum,
int pagesize,
int sortorder,
int sortattribute)
PageControl
public PageControl(PageControl pc)
isAscending
public boolean isAscending()
isDescending
public boolean isDescending()
initDefaults
public static PageControl initDefaults(PageControl pc,
int defaultSortAttr)
- sets the initial defaults for the PageControl. Sort attribute specifies
which attribute to sort on.
- Parameters:
pc
- defaultSortAttr
- specifies the attribute to sort on.
- Returns:
- PageControl
getPagenum
public int getPagenum()
- Returns:
- The current page number (0-based)
setPagenum
public void setPagenum(int pagenum)
- Parameters:
pagenum
- Set the current page number to pagenum
getPagesize
public int getPagesize()
- Returns:
- The current page size
setPagesize
public void setPagesize(int pagesize)
- Parameters:
pagesize
- Set the current page size to this value
getSortorder
public int getSortorder()
- Returns:
- The sort order used. This is one of the SORT_XXX constants.
setSortorder
public void setSortorder(int sortorder)
- Parameters:
sortorder
- Sort order to use, one of the SORT_XXX constants.
getSortattribute
public int getSortattribute()
- Returns:
- The attribute that the sort is based on.
setSortattribute
public void setSortattribute(int attr)
- Parameters:
attr
- Set the attribute that the sort is based on.
getMetaData
public java.io.Serializable getMetaData()
setMetaData
public void setMetaData(java.io.Serializable metaData)
getPageEntityIndex
public int getPageEntityIndex()
- Get the index of the first item on the page as dictated by the
page size and page number.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.lang.Object
Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.