#include <coherence/util/filter/LimitFilter.hpp>
This filter is a mutable object that is modified by the query processor. Clients are supposed to hold a reference to this filter and repetitively pass it to query methods after setting a desired page context calling setPage, nextPage(), or previousPage.
Public Types | |
typedef spec::Handle | Handle |
LimitFilter Handle definition. | |
typedef spec::View | View |
LimitFilter View definition. | |
typedef spec::Holder | Holder |
LimitFilter Holder definition. | |
Public Member Functions | |
virtual bool | evaluateEntry (Map::Entry::View vEntry) const |
virtual bool | evaluate (Object::View v) const |
virtual size32_t | calculateEffectiveness (Map::View vMapIndexes, Set::View vSetKeys) const |
virtual Filter::View | applyIndex (Map::View vMapIndexes, Set::Handle hSetKeys) const |
virtual void | readExternal (PofReader::Handle hIn) |
virtual void | writeExternal (PofWriter::Handle hOut) const |
virtual TypedHandle < const String > | toString () const |
Output a human-readable description of this Object to the given stream. | |
virtual Filter::View | getFilter () const |
Obtain the Filter whose results are truncated by this filter. | |
virtual int32_t | getPageSize () const |
Obtain the page size (expressed as a number of entries per page). | |
virtual void | setPageSize (int32_t cPageSize) |
Set the page size (expressed as a number of entries per page). | |
virtual int32_t | getPage () const |
Obtain a current page number (zero-based). | |
virtual void | setPage (int32_t nPage) |
Set the page number (zero-based). | |
virtual Comparator::View | getComparator () const |
Obtain the Comparator used to partition the entry values into pages. | |
virtual void | setComparator (Comparator::View vComparator) const |
Set the Comparator used to partition the values into pages. | |
virtual Object::View | getTopAnchor () const |
Obtain the top anchor object, which is the last value object on a previous page. | |
virtual void | setTopAnchor (Object::View vAnchor) const |
Set the top anchor object. | |
virtual Object::View | getBottomAnchor () const |
Obtain the bottom anchor object, which is the last value object on the current page. | |
virtual void | setBottomAnchor (Object::View vAnchor) const |
Set the bottom anchor object. | |
virtual Object::View | getCookie () const |
Obtain the cookie object. | |
virtual void | setCookie (Object::View vCookie) const |
Set the cookie object. | |
virtual void | nextPage () |
Switch to the next page. | |
virtual void | previousPage () |
Switch to the previous page. | |
virtual ObjectArray::Handle | extractPage (ObjectArray::Handle haEntry) const |
Extract a subset of the specified array to fit the filter's parameters (i.e. | |
virtual ObjectArray::Handle | extractPage (Iterator::Handle hIter) const |
Extract a subset of the specified iterator to fit the filter's parameters (i.e. | |
Protected Member Functions | |
LimitFilter () | |
Default constructor (necessary for the PortableObject interface). | |
LimitFilter (Filter::View vFilter, int32_t cPageSize) | |
Construct a LimitFilter filter. | |
LimitFilter (const LimitFilter &that) | |
Copy constructor. |
LimitFilter | ( | Filter::View | vFilter, | |
int32_t | cPageSize | |||
) | [protected] |
Construct a LimitFilter filter.
vFilter | the filter whose results this Filter truncates | |
cPageSize | the sie of the page |
virtual TypedHandle<const String> toString | ( | ) | const [virtual] |
Output a human-readable description of this Object to the given stream.
out | the stream used to output the description |
virtual Filter::View getFilter | ( | ) | const [virtual] |
Obtain the Filter whose results are truncated by this filter.
virtual int32_t getPageSize | ( | ) | const [virtual] |
Obtain the page size (expressed as a number of entries per page).
virtual void setPageSize | ( | int32_t | cPageSize | ) | [virtual] |
Set the page size (expressed as a number of entries per page).
cPageSize | the page size |
virtual int32_t getPage | ( | ) | const [virtual] |
Obtain a current page number (zero-based).
virtual void setPage | ( | int32_t | nPage | ) | [virtual] |
Set the page number (zero-based).
Setting the page number to zero will reset the filter's state.
nPage | the page number |
virtual Comparator::View getComparator | ( | ) | const [virtual] |
Obtain the Comparator used to partition the entry values into pages.
This method is intended to be used only by query processors. Clients should not modify the content of this property.
virtual void setComparator | ( | Comparator::View | vComparator | ) | const [virtual] |
Set the Comparator used to partition the values into pages.
This method is intended to be used only by query processors. Clients should not modify the content of this property.
vComparator | Comparator object |
virtual Object::View getTopAnchor | ( | ) | const [virtual] |
Obtain the top anchor object, which is the last value object on a previous page.
This method is intended to be used only by query processors. Clients should not modify the content of this property.
virtual void setTopAnchor | ( | Object::View | vAnchor | ) | const [virtual] |
Set the top anchor object.
This method is intended to be used only by query processors. Clients should not modify the content of this property.
vAnchor | the top anchor object |
virtual Object::View getBottomAnchor | ( | ) | const [virtual] |
Obtain the bottom anchor object, which is the last value object on the current page.
This method is intended to be used only by query processors. Clients should not modify the content of this property.
virtual void setBottomAnchor | ( | Object::View | vAnchor | ) | const [virtual] |
Set the bottom anchor object.
This method is intended to be used only by query processors. Clients should not modify the content of this property.
vAnchor | the bottom anchor object |
virtual Object::View getCookie | ( | ) | const [virtual] |
Obtain the cookie object.
This method is intended to be used only by query processors. Clients should not modify the content of this property.
virtual void setCookie | ( | Object::View | vCookie | ) | const [virtual] |
Set the cookie object.
This method is intended to be used only by query processors. Clients should not modify the content of this property.
vCookie | the cookie object |
virtual ObjectArray::Handle extractPage | ( | ObjectArray::Handle | haEntry | ) | const [virtual] |
Extract a subset of the specified array to fit the filter's parameters (i.e.
page size and page number). If this filter has a comparator, the specified array is presumed to be sorted accordingly.
The returned array is guaranteed to iterate exactly in the same order as the original array.
haEntry | an original array of entries |
virtual ObjectArray::Handle extractPage | ( | Iterator::Handle | hIter | ) | const [virtual] |
Extract a subset of the specified iterator to fit the filter's parameters (i.e.
page size and page number). The returned array is guaranteed to iterate exactly in the same order as the original iterator.
hIter | an original entry iterator |