org.rhq.core.domain.util
Class PageControl
java.lang.Object
org.rhq.core.domain.util.PageControl
- All Implemented Interfaces:
- Serializable, Cloneable
- Direct Known Subclasses:
- UnlimitedPageControl
public class PageControl
- extends Object
- implements Serializable, Cloneable
Used to pass information on pagination and sorting to data lookup methods.
PersistenceUtility
provides several methods
that can be called to apply PageControls to various types of queries.
- See Also:
- Serialized Form
SIZE_UNLIMITED
public static final int SIZE_UNLIMITED
- See Also:
- Constant Field Values
SIZE_MAX
public static final int SIZE_MAX
- See Also:
- Constant Field Values
PageControl
public PageControl()
PageControl
public PageControl(int pageNumber,
int pageSize)
PageControl
public PageControl(int pageNumber,
int pageSize,
OrderingField... orderingFields)
getExplicitPageControl
public static PageControl getExplicitPageControl(int firstRecord,
int recordCount)
getUnlimitedInstance
public static PageControl getUnlimitedInstance()
getSingleRowInstance
public static PageControl getSingleRowInstance()
initDefaultOrderingField
public void initDefaultOrderingField(String defaultField)
addDefaultOrderingField
public void addDefaultOrderingField(String defaultField)
initDefaultOrderingField
public void initDefaultOrderingField(String defaultField,
PageOrdering defaultPageOrdering)
addDefaultOrderingField
public void addDefaultOrderingField(String defaultField,
PageOrdering defaultPageOrdering)
getPageNumber
public int getPageNumber()
- Returns:
- The current page number (0-based)
setPageNumber
public void setPageNumber(int pageNumber)
getPageSize
public int getPageSize()
setPageSize
public void setPageSize(int pageSize)
getFirstRecord
public Integer getFirstRecord()
setFirstRecord
public void setFirstRecord(Integer firstRecord)
getPrimarySortOrder
public PageOrdering getPrimarySortOrder()
setPrimarySortOrder
public void setPrimarySortOrder(PageOrdering sortOrder)
getPrimarySortColumn
public String getPrimarySortColumn()
setPrimarySort
public void setPrimarySort(String sortColumn,
PageOrdering sortOrder)
getOrderingFieldsAsArray
public OrderingField[] getOrderingFieldsAsArray()
getOrderingFields
public List<OrderingField> getOrderingFields()
truncateOrderingFields
public void truncateOrderingFields(int keepFieldCount)
removeOrderingField
public void removeOrderingField(String doomedField)
sortBy
public void sortBy(String sortField)
getStartRow
public int getStartRow()
- Get the index of the first item on the page as dictated by the page size and page number.
- Returns:
- the index of the starting row for the page
reset
public void reset()
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
clone
public Object clone()
- Overrides:
clone
in class Object
Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.