rule
Class RuleVariable

java.lang.Object
  |
  +--rule.Variable
        |
        +--rule.RuleVariable

public class RuleVariable
extends Variable

The RuleVariable class implements the rule variable class used in a boolean rule base.


Field Summary
protected  java.util.Vector clauseRefs
           
protected  java.lang.String promptText
           
protected  BooleanRuleBase rb
           
protected  java.lang.String ruleName
           
 
Fields inherited from class rule.Variable
column, labels, name, value
 
Constructor Summary
RuleVariable(BooleanRuleBase rb, java.lang.String name)
          Creates a new rule variable object with specified name.
 
Method Summary
 void addClauseRef(Clause ref)
          Adds a reference to a rule clause.
 java.lang.String askUser()
          Prompts the user to provide a value for a variable during backward inferencing (set to null if user cancels out of dialog).
 void computeStatistics(java.lang.String inValue)
          Not used.
 java.lang.String getPromptText()
          Retrieves the prompt text for this variable.
 int normalize(java.lang.String inValue, float[] outArray, int inx)
          Not used.
 void setPromptText(java.lang.String prompText)
          Sets the prompt text for this variable.
 void setRuleName(java.lang.String ruleName)
          Sets the rule name.
 void setValue(java.lang.String value)
          Set the value of the variable and retests all clauses that refer to this variable.
 void updateClauses()
          Checks all rule clauses that refer to this variable.
 
Methods inherited from class rule.Variable
categorical, getDecodedValue, getIndex, getLabel, getLabels, getLabelsAsString, getName, getValue, normalizedSize, setColumn, setLabels, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rb

protected BooleanRuleBase rb

clauseRefs

protected java.util.Vector clauseRefs

promptText

protected java.lang.String promptText

ruleName

protected java.lang.String ruleName
Constructor Detail

RuleVariable

public RuleVariable(BooleanRuleBase rb,
                    java.lang.String name)
Creates a new rule variable object with specified name.
Parameters:
rb - the BooleanRuleBase object this rule variable belongs to
name - the String object that contains the name of the variable
Method Detail

setValue

public void setValue(java.lang.String value)
Set the value of the variable and retests all clauses that refer to this variable.
Parameters:
value - the String object that contains the new value
Overrides:
setValue in class Variable

askUser

public java.lang.String askUser()
Prompts the user to provide a value for a variable during backward inferencing (set to null if user cancels out of dialog).
Returns:
the String object that contains the user response

addClauseRef

public void addClauseRef(Clause ref)
Adds a reference to a rule clause.
Parameters:
ref - the Clause object to be added

updateClauses

public void updateClauses()
Checks all rule clauses that refer to this variable.

setRuleName

public void setRuleName(java.lang.String ruleName)
Sets the rule name.
Parameters:
ruleName - the String object that contains the name

setPromptText

public void setPromptText(java.lang.String prompText)
Sets the prompt text for this variable.
Parameters:
prompText - the String object that contains the prompt text

getPromptText

public java.lang.String getPromptText()
Retrieves the prompt text for this variable.
Returns:
the String object that contains the prompt text

computeStatistics

public void computeStatistics(java.lang.String inValue)
Not used.
Parameters:
inValue - the String object
Overrides:
computeStatistics in class Variable

normalize

public int normalize(java.lang.String inValue,
                     float[] outArray,
                     int inx)
Not used.
Parameters:
inValue - the String object
outArray - the float[] object
inx - the int object
Returns:
the int object
Overrides:
normalize in class Variable