|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.apps.groupspace.pagination.GS_PagedResult<T>
public class GS_PagedResult<T extends ContentBase>
GroupSpace-specific paged result, typed to ContentBase
Field Summary | |
---|---|
protected ContentFactory<T> |
contentFactory
|
protected boolean |
isResultPruned
|
Fields inherited from interface com.bea.p13n.pagination.PagedResult |
---|
COUNT_UNKNOWN |
Fields inherited from interface com.bea.p13n.pagination.PagedResult |
---|
COUNT_UNKNOWN |
Constructor Summary | |
---|---|
GS_PagedResult(ContentContext cc,
ISortableFilterablePagedList<Node> nodes,
Class<T> beanClass,
ContentFactory<T> contentFactory,
int batchLoadingSize)
|
Method Summary | |
---|---|
List<T> |
asList()
Use this one when your PageResult was sorted |
Set<T> |
asSet()
Use this one when you don't care about sorting |
void |
close()
Close the result and release any resources which it holds. |
Iterator<T> |
currentPage()
Get an iterator of the current page full of things. |
int |
getCurrentPageNumber()
Get the current page number. |
Set<String> |
getFilterableProperties()
An implementation must report which of its properties can be legaly filtered. |
Locale |
getFilterLocale()
Retrieve the current locale used for filtering. |
FilterMethod |
getFilterMethod()
Retrieve the current state of the filter method (what way the result is currently filtered). |
String |
getFilterProperty()
Retrieve the current state of the property used to filter the result. |
String |
getFilterString()
Retrieve the current state of the string used to filter the result. |
Iterator<T> |
getPage(int pageNumber)
Get the specified page. |
int |
getPageCount()
How many pages are available. |
int |
getPageSize()
Get the size of the pages. |
Set<String> |
getSortableProperties()
An implementation must report which of its properties can be legaly sorted. |
Locale |
getSortLocale()
Retrieve the current locale used for sorting. |
SortOrder |
getSortOrder()
Retrieve the current state of the sort order (what order the result is sorted by). |
String |
getSortProperty()
Retrieve the current state of the property used to sort the result. |
Set<FilterMethod> |
getSupportedFilterMethods()
An implementation must report which FilterMethods it supports. |
int |
getTotalItemCount()
Get the total number of items represented by these pages. |
boolean |
hasNextPage()
Is there a next page? Will a call to nextPage() succeed? |
boolean |
hasPage(int pageNumber)
Does the given page exist? Should a call to getPage( pageNumber ) succeed? Generally, this means that getPageNumber() < getPageCount(), but some iterators may not allow random access to all pages, in which case this might return false even when you could get to that page using next/previous. |
boolean |
hasPreviousPage()
Is there a previous page? Will a call to previousPage() succeed? |
boolean |
isCompleteResults()
Does this result represent a complete set of results? If not, then probably the maximum number of query results was reached and this iterator only represents a subset of the actual query. |
boolean |
isGetPageSupported()
Does this iterator allow random access to pages? This method (vs. |
boolean |
isResultPruned()
|
Iterator<T> |
nextPage()
Get an iterator of the next page full of things. |
Iterator<T> |
previousPage()
Get an iterator of the previous page full of things. |
void |
reFilter(FilterMethod filterMethod,
String filterString,
String filterProperty,
Locale filterLocale)
Refilter the results. |
void |
resize(int pageSize)
Set a new page size. |
void |
reSort(SortOrder sortOrder,
String sortProperty,
Locale sortLocale)
Resort the results. |
void |
setIsResultPruned(boolean isResultPruned)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ContentFactory<T extends ContentBase> contentFactory
protected boolean isResultPruned
Constructor Detail |
---|
public GS_PagedResult(ContentContext cc, ISortableFilterablePagedList<Node> nodes, Class<T> beanClass, ContentFactory<T> contentFactory, int batchLoadingSize)
Method Detail |
---|
public int getPageSize()
getPageSize
in interface PagedResult
public int getTotalItemCount()
getTotalItemCount
in interface PagedResult
public int getPageCount()
getPageCount
in interface PagedResult
public boolean isCompleteResults()
isCompleteResults
in interface PagedResult
public boolean isResultPruned()
public void setIsResultPruned(boolean isResultPruned)
public int getCurrentPageNumber()
getCurrentPageNumber
in interface PagedResult
public boolean hasNextPage()
hasNextPage
in interface PagedResult
public boolean hasPreviousPage()
hasPreviousPage
in interface PagedResult
public Iterator<T> previousPage() throws NoSuchElementException
previousPage
in interface PagedResult
NoSuchElementException
- if there is no previous page.public boolean isGetPageSupported()
isGetPageSupported
in interface PagedResult
public boolean hasPage(int pageNumber)
hasPage
in interface PagedResult
public Iterator<T> getPage(int pageNumber) throws IndexOutOfBoundsException, UnsupportedOperationException
getPage
in interface PagedResult
IndexOutOfBoundsException
- if the pageNumber is negative or
is after the last page.
UnsupportedOperationException
- if this PageIterator does not
support random access of pages (or of that page).public void close()
close
in interface PagedResult
public void resize(int pageSize) throws IllegalArgumentException
resize
in interface PagedResult
IllegalArgumentException
- if pageSize is less than or equal to zeropublic Iterator<T> nextPage() throws NoSuchElementException
nextPage
in interface PagedResult
NoSuchElementException
- if there is no next page.public Iterator<T> currentPage() throws NoSuchElementException
NoSuchElementException
- if there is no next page.public SortOrder getSortOrder()
getSortOrder
in interface SortablePagedResult
public Set<String> getSortableProperties()
getSortableProperties
in interface SortablePagedResult
public String getSortProperty()
getSortProperty
in interface SortablePagedResult
public Locale getSortLocale()
getSortLocale
in interface SortablePagedResult
public void reSort(SortOrder sortOrder, String sortProperty, Locale sortLocale) throws UnsupportedOperationException
Most implementations should not simply reorder the current data, but should rather reissue page queries to retrieve sorted results.
reSort
in interface SortablePagedResult
sortOrder
- the new order to use for sorting. Null is not allowed.sortProperty
- the property of the result to use for sorting.
If sortOrder is UNSORTED, this property is probably ignored (and reSort is
not actually required to do anything at all). Must not be null or empty,
unless sortOrder is UNSORTED or the implementation chooses to ignore it.
Otherwise this must be one of the properties reported by getSortableProperties.sortLocale
- locale used to sort. Null implies that sorting should not
be based on Locale. Might be ignored if the bean or property being sorted
does not support locale-based sorting (i.e. the property is an Integer).
UnsupportedOperationException
- if the sort can not be performed on
the given property.
IllegalArgumentException
- if sortOrder is null, or if the sortProperty
is null or empty string when sortOrder is something other than UNSORTED.public Set<FilterMethod> getSupportedFilterMethods()
getSupportedFilterMethods
in interface FilterablePagedResult
public Set<String> getFilterableProperties()
getFilterableProperties
in interface FilterablePagedResult
public FilterMethod getFilterMethod()
getFilterMethod
in interface FilterablePagedResult
public String getFilterString()
getFilterString
in interface FilterablePagedResult
public String getFilterProperty()
getFilterProperty
in interface FilterablePagedResult
public Locale getFilterLocale()
getFilterLocale
in interface FilterablePagedResult
public void reFilter(FilterMethod filterMethod, String filterString, String filterProperty, Locale filterLocale) throws UnsupportedOperationException, IllegalArgumentException
reFilter
in interface FilterablePagedResult
filterMethod
- the new method to use for filtering. Null is not allowed.filterString
- the string to use for filtering.
If filterMethod is UNFILTERED, this is probably ignored,
but reFilter should then reissue the query to return a full unfiltered set
of results. May not be null or empty, unlesss filterMethod is UNFILTERED.filterProperty
- the property of the result to use for filtering.
If filterMethod is UNFILTERED, this property is probably ignored (and
reFilter simply resets to the full result set). Must not be null or empty,
unless filterMethod is UNFILTERED or the implementation chooses to ignore it.
Oherwise this should match one of the names returned by getFilterableProperties.filterLocale
- locale used to filter. Null implies that filtering should not
be based on Locale. Might be ignored if the bean or property being filtered
does not support locale-based filtering (i.e. the property is an Integer or
has no associated localized content).
UnsupportedOperationException
- if filtering can not be performed for
the given property or method.
IllegalArgumentException
- if filterMethod is null, or if the filterExpression
or filterPropery are null or empty string when filterMethod is anything
other than UNFILTERED.public Set<T> asSet()
public List<T> asList()
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |