Oracle Coherence for C++ API
Release 3.6.0.0

E15728-01

LimitFilter Class Reference

#include <coherence/util/filter/LimitFilter.hpp>

Inherits Object, IndexAwareFilter, and PortableObject.

List of all members.


Detailed Description

Filter which truncates the results of another filter.

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.

Author:
djl 2008.04.14

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
  Apply the test to a Map::Entry.
Parameters:
vEntry  the Map::Entry to evaluate; never NULL
Returns:
true if the test passes, false otherwise

virtual bool  evaluate (Object::View v) const
  Apply the test to the object.
Parameters:
v  the object to test
Returns:
true if the test passes, false otherwise

virtual size32_t  calculateEffectiveness (Map::View vMapIndexes, Set::View vSetKeys) const
  Given a Map of available indexes, determine if this IndexAwareFilter can use any of the indexes to assist in its processing, and if so, determine how effective the use of that index would be.

The returned value is an effectiveness estimate of how well this filter can use the specified indexes to filter the specified keys. An operation that requires no more than a single access to the index content (i.e. Equals, NotEquals) has an effectiveness of one. Evaluation of a single entry is assumed to have an effectiveness that depends on the index implementation and is usually measured as a constant number of the single operations. This number is referred to as evaluation cost.

If the effectiveness of a filter evaluates to a number larger than the keySet.size() * <evaluation cost> then a user could avoid using the index and iterate through the keySet calling evaluate rather then applyIndex.

Parameters:
vMapIndexes  the available MapIndex objects keyed by the related ValueExtractor; read-only
vSetKeys  the set of keys that will be filtered; read-only
Returns:
an effectiveness estimate of how well this filter can use the specified indexes to filter the specified keys

virtual Filter::View  applyIndex (Map::View vMapIndexes, Set::Handle hSetKeys) const
  Filter remaining keys using a Map of available indexes.

The filter is responsible for removing all keys from the passed set of keys that the applicable indexes can prove should be filtered. If the filter does not fully evaluate the remaining keys using just the index information, it must return a filter (which may be an EntryFilter) that can complete the task using an iterating implementation. If, on the other hand, the filter does fully evaluate the remaining keys using just the index information, then it should return null to indicate that no further filtering is necessary.

Parameters:
vMapIndexes  the available MapIndex objects keyed by the related ValueExtractor; read-only
hSetKeys  the mutable set of keys that remain to be filtered
Returns:
a Filter object (which may be an EntryFilter) that can be used to process the remaining keys, or null if no additional filter processing is necessary

virtual void  readExternal (PofReader::Handle hIn)
 
virtual void  writeExternal (PofWriter::Handle hOut) const
 
virtual void  toStream (std::ostream &out) 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)
  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)
  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)
  Set the bottom anchor object.
virtual Object::View  getCookie () const
  Obtain the cookie object.
virtual void  setCookie (Object::View vCookie)
  Set the cookie object.
virtual void  nextPage ()
  Switch to the next page.
virtual void  previousPage ()
  Switch to the previous page.

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.

Constructor & Destructor Documentation

LimitFilter ( Filter::View  vFilter,
int32_t  cPageSize  
) [protected]

Construct a LimitFilter filter.

Parameters:
vFilter  the filter whose results this Filter truncates
cPageSize  the sie of the page

Member Function Documentation

virtual void toStream ( std::ostream &  out  )  const [virtual]

Output a human-readable description of this Object to the given stream.

Parameters:
out  the stream used to output the description

Reimplemented from Object.

virtual Filter::View getFilter (  )  const [virtual]

Obtain the Filter whose results are truncated by this filter.

Returns:
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).

Returns:
the page size

virtual void setPageSize ( int32_t  cPageSize  )  [virtual]

Set the page size (expressed as a number of entries per page).

Parameters:
cPageSize  the page size

virtual int32_t getPage (  )  const [virtual]

Obtain a current page number (zero-based).

Returns:
the page number

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.

Parameters:
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.

Returns:
the Comparator object

virtual void setComparator ( Comparator::View  vComparator  )  [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.

Parameters:
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.

Returns:
top anchor object

virtual void setTopAnchor ( Object::View  vAnchor  )  [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.

Parameters:
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.

Returns:
bottom anchor object

virtual void setBottomAnchor ( Object::View  vAnchor  )  [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.

Parameters:
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.

Returns:
cookie object

virtual void setCookie ( Object::View  vCookie  )  [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.

Parameters:
vCookie  the cookie object

The documentation for this class was generated from the following file:
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.