| Modifier | Constructor and Description |
|---|---|
|
Decisiontable()
Create a new decision table with one node and one rule.
All rules and nodes will be created with default values. |
protected |
Decisiontable(ArrayList<Rule> rules,
ArrayList<Node> nodes)
Create a new decision table from list of nodes and rules.
This constructor is meant for cloning a decision table only. |
|
Decisiontable(int numberOfRules,
ArrayList<String> nodeNames)
Create a new decision table with a user-defined number of rules using a list of strings (= node names) to create nodes from.
All rules will be created with default values. |
|
Decisiontable(int numberOfRules,
int numberOfNodes)
Create a new decision table with a user-defined number of nodes and rules.
All rules and nodes will be created with default values. |
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(int nodePos)
Adds a new node with default values (see class Node).
|
void |
addRule(int rulePos)
Adds a new rule with default values (see class Rule).
|
boolean |
checkNodeHasYesInValidRule()
Same as checkNodeHasYesInValidRule(true).
|
boolean |
checkNodeHasYesInValidRule(boolean setCheckFailedFlag)
Check if all nodes have at least one Yes-decision in at least one valid rule.
Important: Any decision table for which this check fails can be still valid! Therefore this check is meant for detecting possible flaws in a decision table. |
boolean |
checkNoNodeWithDontcareOnly()
Same as checkNoNodeWithDontcareOnly(true).
|
boolean |
checkNoNodeWithDontcareOnly(boolean setCheckFailedFlag)
Checks each node if there is among all belonging decisions at least one decision which has a Yes or a No.
A node which has only "don't care" - decisions wouldn't detected neither by a check for disjunct rules nor by a check for actual / expected number of rules. Example 1: 1 Y Y N 2 Y N - 3 N - - This decision table is OK. Example 2: 1 Y Y N 2 - - - 3 Y N - This decision table is not OK because node 2 got only "don't care" decisions. |
Long |
checkNumberOfRules()
Calculates the difference between the expected and the actual number of rules.
Example 1: 2 rules found, 4 rules expected => 2 - 4 = - 2 => 2 rules missing Example 2: 4 rules found, 4 rules expected => 4 - 4 = 0 => number of rules is OK There is no chance to get too much rules because you can generate more rules only by (a) replacing a Yes or No by a "don't care" or (b) adding nodes. |
boolean |
checkRulesForBeingDisjunct()
Same as checkRulesForBeingDisjunct(true).
|
boolean |
checkRulesForBeingDisjunct(boolean setCheckFailedFlag)
Checks if all rules are disjunct.
|
Decisiontable |
clone()
This method returns a clone of this decision table.
|
void |
cloneNode(int sourcePos,
int destinationPos)
Clone a node and add it to the decision table.
If sourcePos and destinationPos are equal nothing happens. If destinationPos is out of range also nothing will happen. |
void |
cloneRule(int sourcePos,
int destinationPos)
Clone a rule and add it to the decision table.
If sourcePos and destinationPos are equal nothing happens. If destinationPos is out of range also nothing will happen. |
long |
getActualNumberOfRules()
Calculates the number of rules contained in this decision table by asking each rule for the number of "theoretical rules" contained in it and adding these numbers.
If there are "don't care" decisions in your decision table this number is greater than the number returned by Decisiontable.getNumRules(). |
Decision |
getDecision(int rulePos,
int nodePos)
This method returns the decision for a given cell in the decision table.
The cell in the decision table is named by the position of a node and a rule. |
long |
getExpectedNumberOfRules()
Calculates the number of "theoretical rules" expected for this decision table.
This is done by computing 2 power of (number of nodes). Example: If we have two nodes we expect to have 2 power of 2 = 4 rules. So we can do a mathematical check of completeness of our decision table by comparing the expected and the actual number of decisions. |
Node |
getNode(int nodePos)
This method returns a reference to the node from a given position in the decision table.
|
Integer[] |
getNodesCheckFailed()
This method returns the positions of those nodes for which the last check failed.
|
int |
getNumNodes()
This method returns the number of nodes in this decision table.
|
int |
getNumRules()
This method returns the number of rules in this decision table.
|
Rule |
getRule(int rulePos)
This method returns a reference to the rule from a given position in the decision table.
|
int[] |
getRulesCheckFailed()
Reads the result of Rule.isDisjunct(Rule other) for each rule and returns the result always as an int[2].
|
int[] |
getRulesNotDisjunct()
Deprecated.
This method is replaced by getRulesCheckFailed() for having a general checkFailed flag in class Node and Rule and will be removed in the future (2014 or later).
|
Rule[] |
getValidRules()
Get all valid rules from the decision table.
|
Node |
removeNode(int nodePos)
This method removes a node.
After the last node was removed a new node with default values (see class Node) will be created. |
Rule |
removeRule(int rulePos)
This method removes a rule.
After the last rule was removed a new rule with default values (see class Rule) will be created. |
void |
resetIsDisjunctFlag()
Deprecated.
This method is replaced by resetRuleCheckFailedFlag() for having a general checkFailed flag in class Node and Rule and will be removed in the future (2014 or later).
|
void |
resetNodeCheckFailedFlag()
This method resets the flag checkFailed in all nodes.
|
void |
resetRuleCheckFailedFlag()
This method resets the flag checkFailed in all rules.
|
boolean |
runAllChecks()
This method runs all checks necessary to assure the technical completeness of a decision table.
|
void |
setDecision(int rulePos,
int nodePos,
Decision decision)
This method sets the decision for a given cell in the decision table.
The cell in the decision table is named by the position of a node and a rule. |
public Decisiontable()
public Decisiontable(int numberOfRules,
int numberOfNodes)
throws IllegalArgumentException
numberOfRules - Number of rules which will be created.numberOfNodes - Number of nodes which will be created.IllegalArgumentException - if either number of rules < 1 or number of nodes < 1protected Decisiontable(ArrayList<Rule> rules, ArrayList<Node> nodes) throws IllegalArgumentException
rules - list of rules to create the new decision table ofnodes - list of nodes to create the new decision table ofIllegalArgumentException - is either list of rules or list of nodes is emptypublic Decisiontable(int numberOfRules,
ArrayList<String> nodeNames)
throws IllegalArgumentException
numberOfRules - Number of rules which will be created.nodeNames - List strings used as node names.IllegalArgumentException - if the number of rules < 1 or if the list of node names is empty.public Decisiontable clone()
public void cloneNode(int sourcePos,
int destinationPos)
sourcePos - position of the node which will be cloneddestinationPos - position there the clone will be insertedpublic void cloneRule(int sourcePos,
int destinationPos)
sourcePos - position of the rule which will be cloneddestinationPos - position there the clone will be insertedpublic void addNode(int nodePos)
nodePos - position where the node will insertedpublic Node removeNode(int nodePos)
nodePos - position of the node which will be removedpublic void addRule(int rulePos)
rulePos - position where the rule will insertedpublic Rule removeRule(int rulePos)
rulePos - position of the rule which will be removedpublic Decision getDecision(int rulePos, int nodePos)
rulePos - position of the rulenodePos - position of the nodepublic void setDecision(int rulePos,
int nodePos,
Decision decision)
rulePos - position of the rulenodePos - position of the nodedecision - on rulePos, nodePospublic Node getNode(int nodePos)
nodePos - get the node from this positionpublic Rule getRule(int rulePos)
rulePos - get the rule from this positionpublic int getNumNodes()
public int getNumRules()
public Rule[] getValidRules()
public boolean checkNodeHasYesInValidRule(boolean setCheckFailedFlag)
setCheckFailedFlag - If true it will mark each node for which the check failed by setting the flag checkFailed to true. If false it will leave this flag on false. This method will - of course - reset the checkFailed flag for all nodes before executing the check to false.public boolean checkNodeHasYesInValidRule()
public boolean checkNoNodeWithDontcareOnly(boolean setCheckFailedFlag)
setCheckFailedFlag - If true it will mark each node for which the check failed by setting the flag checkFailed to true. If false it will leave this flag on false. This method will - of course - reset the checkFailed flag for all nodes before executing the check to false.public boolean checkNoNodeWithDontcareOnly()
public boolean checkRulesForBeingDisjunct(boolean setCheckFailedFlag)
setCheckFailedFlag - If true it will mark each rule for which the check failed by setting the flag checkFailed to true. If false it will leave this flag on false. This method will - of course - reset the checkFailed flag for all rules before executing the check to false.public boolean checkRulesForBeingDisjunct()
public long getActualNumberOfRules()
public long getExpectedNumberOfRules()
public Long checkNumberOfRules()
public boolean runAllChecks()
public Integer[] getNodesCheckFailed()
public int[] getRulesCheckFailed()
public int[] getRulesNotDisjunct()
public void resetNodeCheckFailedFlag()
public void resetRuleCheckFailedFlag()
public void resetIsDisjunctFlag()
Copyright © 2013. All Rights Reserved.