public class RuleSet extends Object
The rules are stored as Rule
in an List
.
Modifier and Type | Field and Description |
---|---|
private int |
extensional |
private int |
intensional |
private List<Rule> |
rules |
Constructor and Description |
---|
RuleSet(List<Rule> rules)
Constructor of the class.
|
RuleSet(Rule... rules)
Constructor of the class.
|
Modifier and Type | Method and Description |
---|---|
void |
addRule(Rule rule)
Adds the specified rule.
|
void |
addRules(List<Rule> rules)
Adds all the rules that are in the specified
List . |
int |
getExtensional()
Gets the position of the last extensional rule.
|
int |
getIntensional()
Gets the position of the last intensional rule.
|
Rule |
getRule(int index)
Gets the rule at the specified position.
|
int |
getRuleCount()
Gets the size of the set.
|
List<Rule> |
getRules()
Gets all the rules of the set.
|
Rule |
getRuleStandardizedApart(int index)
Gets the standardized version of the rule number
index . |
void |
setExtensional(int i)
Sets the position of the last extensional rule.
|
void |
setIntensional(int i)
Sets the position of the last intensional rule.
|
String |
toString()
Returns the set in the form of:
"{
rule1
rule2
...
}".
|
public RuleSet(Rule... rules)
rules
- the rules of the set in an array or as independent arguments.public void setIntensional(int i)
i
- the index of the last intensional rule.public int getIntensional()
public void setExtensional(int i)
i
- the index of the last extensional rule.public int getExtensional()
public Rule getRuleStandardizedApart(int index)
index
. This uses
the method standardizeVariablesApart()
on the rule at the specified index.index
- the position of the rule in the set.Rule
object representing the standardized rule which
was at the specified position.public Rule getRule(int index)
index
- the position of the ruleRule
object representing the specified rule.public List<Rule> getRules()
List
object containing the rules of the set.public int getRuleCount()
public void addRules(List<Rule> rules)
List
.rules
- the List
object containing the rules to add.public void addRule(Rule rule)
rule
- the Rule
object representing the rule to add.public String toString()
toString
in class Object
Object.toString()