|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cs.ai.kreator.logic.metaconstraints.ExclusionConstraint
public class ExclusionConstraint
This class implements the MetaConstraint which excludes a set of constants from the substitution for a variable, e.g. [X != (anton, bert, cathy)]
Constructor Summary | |
---|---|
ExclusionConstraint(Variable var,
java.util.Collection<? extends Constant> consts)
Creates a new ExclusionConstraint object with a given
Variable and a given Collection of Constant s. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Return true if other is a MetaConstraint and both have equal attributes. |
java.util.Set<Constant> |
getConstants()
|
java.util.Set<Variable> |
getVariables()
Returns all variables appearing in this constraint. |
int |
hashCode()
|
boolean |
isValidSubstitution(java.util.Map<Variable,Constant> substitution)
Checks if a given substitution violates this MetaConstraint . |
java.lang.String |
toLatex()
Returns a Latex grammar conform string to generate variables, rules (conditionals) etc. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExclusionConstraint(Variable var, java.util.Collection<? extends Constant> consts)
ExclusionConstraint
object with a given
Variable
and a given Collection
of Constant
s.
var
- the Variable
consts
- the Constant
sMethod Detail |
---|
public boolean isValidSubstitution(java.util.Map<Variable,Constant> substitution)
MetaConstraint
MetaConstraint
.
E.g if this is a NotEqualConstraint
like X!=Y,
then substitution.get(X).equals(substitution.get(Y) == false will be returned.
If this is an ExclusionConstraint
X != (v_1, ... ,v_n) then substitution.get(X).equals(v_1)
should hold for all 1<= i <= n.
isValidSubstitution
in interface MetaConstraint
substitution
- the substitution to check.
MetaConstraint
is violated by the given susbtitution.public java.lang.String toString()
toString
in interface MetaConstraint
toString
in class java.lang.Object
String
representation of this MetaConstraint
.public java.lang.String toLatex()
Latexable
toLatex
in interface Latexable
toLatex
in interface MetaConstraint
public java.util.Set<Variable> getVariables()
MetaConstraint
getVariables
in interface MetaConstraint
public java.util.Set<Constant> getConstants()
Constant
s which this ExclusionConstraint
excludes for the Variable
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
MetaConstraint
MetaConstraint
and both have equal attributes.
equals
in interface MetaConstraint
equals
in class java.lang.Object
obj
- a Object
MetaConstraint
and both have equal attributes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |