public class Rule
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Rule.RuleType |
Constructor and Description |
---|
Rule(java.lang.String id,
Rule.RuleType ruleType)
Creates a new rule, with the given identifier and type, and an empty list of
cases
|
Modifier and Type | Method and Description |
---|---|
void |
addCase(Condition condition,
RuleOutput output)
Adds a new case to the abstract rule
|
boolean |
equals(java.lang.Object o)
Returns true if o is a rule that has the same identifier, rule type and list
of cases than the current rule.
|
java.util.Set<Effect> |
getEffects()
Returns the set of all possible effects in the rule.
|
java.util.Set<Template> |
getInputVariables()
Returns the input variables (possibly underspecified, with slots to fill) for
the rule
|
RuleOutput |
getOutput(Assignment input)
Returns the first rule output whose condition matches the input assignment
provided as argument.
|
java.util.Set<java.lang.String> |
getParameterIds()
Returns the set of all parameter identifiers employed in the rule
|
java.lang.String |
getRuleId()
Returns the rule identifier
|
Rule.RuleType |
getRuleType()
Returns the rule type
|
int |
hashCode()
Returns the hashcode for the rule
|
java.lang.String |
toString()
Returns a string representation for the rule
|
public Rule(java.lang.String id, Rule.RuleType ruleType)
id
- the identifierruleType
- the rule typepublic void addCase(Condition condition, RuleOutput output)
condition
- the conditionoutput
- the corresponding outputpublic java.lang.String getRuleId()
public java.util.Set<Template> getInputVariables()
public RuleOutput getOutput(Assignment input)
input
- the input assignmentpublic Rule.RuleType getRuleType()
public java.util.Set<java.lang.String> getParameterIds()
public java.util.Set<Effect> getEffects()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare