casa
$Rev:20696$
|
Rule that can be used to filter rows based upon field values. More...
#include <TBFilterRules.qo.h>
Public Member Functions | |
TBFilterRule (String field, Comparator comparator, TBData *value, TBData *value2=NULL, bool isNot=false, bool anyField=false) | |
Constructor that takes the rule parameters. | |
~TBFilterRule () | |
String | getField () |
Returns the field this rule applies to, or blank if it applies to any field. | |
Comparator | getComparator () |
Returns this rule's comparator. | |
TBData * | getValue () |
Returns this rule's value. | |
TBData * | getValue2 () |
Returns this rule's second value, or blank if it doesn't have one. | |
bool | getIsNot () |
Returns true if this rule is negated (i.e., "not equal" rather than "equal"), false otherwise. | |
bool | getAnyField () |
Returns true if this rule applies to any field, false otherwise. | |
bool | equals (TBFilterRule *r) |
Returns true if this rule is equal to the given rule, false otherwise. | |
int | rowPasses (TBTable *table, int row) |
Checks the given row in the given table. | |
Private Member Functions | |
int | anyFieldPasses (TBTable *table, int row) |
Checks all fields in the given row. | |
Private Attributes | |
String | field |
This rule's field. | |
Comparator | comparator |
This rule's comparator. | |
TBData * | value |
This rule's value. | |
TBData * | value2 |
This rule's second value. | |
bool | isNot |
Indicates whether this rule is negated or not. | |
bool | anyField |
Indicates whether this rule applies to any field or not. |
Rule that can be used to filter rows based upon field values.
A TBFilterRule is a single rule that consists of a field, a Comparator, and the rule parameters. A rule consists of one comparator and at least one value. A rule can be negated (i.e., "not equal"), or applied to any field (i.e., any field with a value > 5).
Definition at line 57 of file TBFilterRules.qo.h.
casa::TBFilterRule::TBFilterRule | ( | String | field, |
Comparator | comparator, | ||
TBData * | value, | ||
TBData * | value2 = NULL , |
||
bool | isNot = false , |
||
bool | anyField = false |
||
) |
Constructor that takes the rule parameters.
value should be the value being compared against; value2 can only be NULL if the comparator only takes one argument. isNot should be true for negated rules, false otherwise. anyField should be true if the rule applies to any field, false otherwise. The rule "owns" value and value2 in that, upon deletion, they are deleted as well.
int casa::TBFilterRule::anyFieldPasses | ( | TBTable * | table, |
int | row | ||
) | [private] |
Checks all fields in the given row.
If any of the fields pass, the index of the first field to pass is returned; otherwise, -1 is returned.
bool casa::TBFilterRule::equals | ( | TBFilterRule * | r | ) |
Returns true if this rule is equal to the given rule, false otherwise.
bool casa::TBFilterRule::getAnyField | ( | ) |
Returns true if this rule applies to any field, false otherwise.
Returns this rule's comparator.
Returns the field this rule applies to, or blank if it applies to any field.
bool casa::TBFilterRule::getIsNot | ( | ) |
Returns true if this rule is negated (i.e., "not equal" rather than "equal"), false otherwise.
Returns this rule's value.
Returns this rule's second value, or blank if it doesn't have one.
int casa::TBFilterRule::rowPasses | ( | TBTable * | table, |
int | row | ||
) |
Checks the given row in the given table.
If the row passes, the index of the first field to pass is returned; if the row does not pass, -1 is returned.
bool casa::TBFilterRule::anyField [private] |
Indicates whether this rule applies to any field or not.
Definition at line 117 of file TBFilterRules.qo.h.
Comparator casa::TBFilterRule::comparator [private] |
This rule's comparator.
Definition at line 105 of file TBFilterRules.qo.h.
String casa::TBFilterRule::field [private] |
This rule's field.
Definition at line 102 of file TBFilterRules.qo.h.
bool casa::TBFilterRule::isNot [private] |
Indicates whether this rule is negated or not.
Definition at line 114 of file TBFilterRules.qo.h.
TBData* casa::TBFilterRule::value [private] |
This rule's value.
Definition at line 108 of file TBFilterRules.qo.h.
TBData* casa::TBFilterRule::value2 [private] |
This rule's second value.
Definition at line 111 of file TBFilterRules.qo.h.