bre20::FormWithRules Class Reference

Base class for all classes that need rules. More...

Inheritance diagram for bre20::FormWithRules:

bre20::LogAnalyzer bre20::Logger List of all members.

Public Member Functions

 FormWithRules ()
 basic constructor
 FormWithRules (ArrayList *rulearray)
virtual int replaceRule (String *modified, bool all, Rule *rule)
virtual bool hasRule (String *modified, bool all)
virtual int findRule (String *modified, bool all)
virtual bool removeRule (String *modified, bool all)
virtual bool removeRule (Rule *rule)

Static Public Attributes

static const int ERR_NOT_FOUND = -1
 if rule is not found
static const int ERR_ERROR = -2
 if there is a real error
static const int REPLACED = 1
 if the rule was replaced

Protected Member Functions

virtual bool executeRules ()
virtual bool setupRules ()
virtual bool finishRules ()
virtual bool executeReplays (String *keys[], Hashtable *values)
virtual bool updateRules ()

Protected Attributes

ArrayList * rules
 list of rules

Detailed Description

Base class for all classes that need rules.


Constructor & Destructor Documentation

bre20::FormWithRules::FormWithRules  ) 
 

basic constructor

bre20::FormWithRules::FormWithRules ArrayList *  rulearray  ) 
 

rule loading constructor

Parameters:
rulearray an array of rules to load


Member Function Documentation

bool bre20::FormWithRules::executeReplays String *  keys[],
Hashtable *  values
[protected, virtual]
 

bool bre20::FormWithRules::executeRules  )  [protected, virtual]
 

executes all rules

Returns:
false if failed

int bre20::FormWithRules::findRule String *  modified,
bool  all
[virtual]
 

Attempts to find a Rule

Parameters:
modified the rule field of the Rule to replace
all set to true if you want to match all fields in the rule field
Returns:
the index of the rule or one of the static ints: ERR_ERROR, ERR_NOT_FOUND

bool bre20::FormWithRules::finishRules  )  [protected, virtual]
 

bool bre20::FormWithRules::hasRule String *  modified,
bool  all
[virtual]
 

Attempts to find a rule

Parameters:
modified the rule field of the Rule to replace
all set to true if you want to match all fields in the rule field
Returns:
true if the rule is found

bool bre20::FormWithRules::removeRule Rule rule  )  [virtual]
 

Attempts to remove a Rule

Parameters:
rule the Rule to remove
Returns:
true if removed

bool bre20::FormWithRules::removeRule String *  modified,
bool  all
[virtual]
 

Attempts to find a Rule and remove it

Parameters:
modified the rule field of the Rule to replace
all set to true if you want to match all fields in the rule field
Returns:
true if removed

int bre20::FormWithRules::replaceRule String *  modified,
bool  all,
Rule rule
[virtual]
 

Replaces a rule with your rule

Parameters:
modified the rule field of the Rule to replace
all set to true if you want to match all fields in the rule field
rule the Rule to replace the old one
Returns:
one of the static ints: ERR_ERROR, ERR_NOT_FOUND, REPLACED

bool bre20::FormWithRules::setupRules  )  [protected, virtual]
 

sets up all rules

Returns:
false if failed

bool bre20::FormWithRules::updateRules  )  [protected, virtual]
 


Member Data Documentation

const int bre20::FormWithRules::ERR_ERROR = -2 [static]
 

if there is a real error

const int bre20::FormWithRules::ERR_NOT_FOUND = -1 [static]
 

if rule is not found

const int bre20::FormWithRules::REPLACED = 1 [static]
 

if the rule was replaced

ArrayList* bre20::FormWithRules::rules [protected]
 

list of rules




BRE Documentation Home