Class Rule
java.lang.Object
COM.TIBCO.hawk.config.rbengine.rulebase.RulebaseElement
COM.TIBCO.hawk.config.rbengine.rulebase.Rule
- All Implemented Interfaces:
Cloneable
Rule objects are the primary components of a rulebase.
A Rule object consists primarilly of a data source and a
list of tests.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionRule(DataSource ds, Test[] tests) Constructs a Rule objectprotectedRule(COM.TIBCO.hawk.util.xml.XmlElementNode xmlNode) Constructs a Rule -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRemoves all the test in this rule.clone()Returns a copy of this objectbooleanTests two Rule objects for equalityprotected voidfromXML(COM.TIBCO.hawk.util.xml.XmlElementNode node) Read XML representation of the rule from the XML node.Returns the rule's data source.protected StringReturns the default name for this ClearAction element.intReturns the rule's precedence level used in overruling.Test[]getTests()Returns the array of Test objects used by this rule.booleanvoidSets the rule's data source.voidsetOverRuling(int precedence) Sets the rule's precedence level used in overruling.voidSets the array of Test objects used by this rule.toString()Returns string representation of this rule.protected voidtoXML(COM.TIBCO.hawk.util.xml.XmlWriter out) Write XML representation of the rule to the XML writer.Methods inherited from class COM.TIBCO.hawk.config.rbengine.rulebase.RulebaseElement
fromXML, fromXML, getName, getSchedule, loadFromFile, saveToFile, setName, setSchedule, toXML, toXML
-
Field Details
-
CNAME
-
-
Constructor Details
-
Rule
Constructs a Rule object- Parameters:
ds- the rule's data sourcetests- an array of Test objects, all tests must have unique names.- Throws:
IllegalArgumentException- if either argument is nullIllegalArgumentException- if any of the test names are not unique
-
Rule
Constructs a Rule- Parameters:
xmlNode- XML node that contain the Rule- Throws:
RulebaseException
-
-
Method Details
-
isConverted
public boolean isConverted() -
toString
Returns string representation of this rule. -
setOverRuling
public void setOverRuling(int precedence) Sets the rule's precedence level used in overruling. -
getOverRuling
public int getOverRuling()Returns the rule's precedence level used in overruling. -
getDataSource
Returns the rule's data source. -
setDataSource
Sets the rule's data source.- Parameters:
ds- the data source, may not be null- Throws:
IllegalArgumentException- if ds is null
-
setTests
Sets the array of Test objects used by this rule.- Parameters:
tests- the array of tests, may not be null, all names must be unique- Throws:
IllegalArgumentException- if tests is nullIllegalArgumentException- if the test names are not unique
-
getTests
Returns the array of Test objects used by this rule. -
equals
Tests two Rule objects for equality- Overrides:
equalsin classRulebaseElement- Returns:
- true if the objects are the same; false otherwise
-
clone
Returns a copy of this object- Specified by:
clonein classRulebaseElement
-
getDefaultName
Returns the default name for this ClearAction element. This is a generated name so that if the name of this ClearAction is not given, this method will provide one. -
clearTests
protected void clearTests()Removes all the test in this rule. -
toXML
Write XML representation of the rule to the XML writer.- Overrides:
toXMLin classRulebaseElement- Parameters:
out- the XML writer where the output will be written.- Throws:
IOExceptionRulebaseException
-
fromXML
Read XML representation of the rule from the XML node.- Overrides:
fromXMLin classRulebaseElement- Parameters:
node- the XML node containing the rule.- Throws:
RulebaseException
-