public class Constraint
extends java.lang.Object
| Constructor and Description |
|---|
Constraint(java.lang.String text,
java.util.ArrayList<Parameter> params)
Constructs a constraint.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
convert(Parameter param,
int index)
Convert internal values to external values for constraint evaluation with the
following logic:
Boolean parameter: Use the real Boolean object.
|
boolean |
eval(int[] test)
Evaluates this constraint against a given test
|
boolean |
eval(edu.uta.cse.fireeye.service.engine.PVPair p) |
boolean |
eval(edu.uta.cse.fireeye.service.engine.PVPair p1,
edu.uta.cse.fireeye.service.engine.PVPair p2)
Evaluates this constraint against two parameter value pairs.
|
boolean |
eval(edu.uta.cse.fireeye.service.engine.Tuple tuple)
Evaluates this constraint against a given tuple.
|
Parameter |
getHiddenParameter() |
edu.uta.cse.fireeye.service.constraint.HiddenParameterHelper |
getHiddenParameterHelper() |
java.util.ArrayList<Parameter> |
getParams()
Returns the list of parameters involved in this constraint.
|
java.lang.String |
getText()
Gets the text of this constraint.
|
boolean |
involved(Parameter param)
Checks if a parameter is involved in this constraint.
|
void |
setParams(java.util.ArrayList<Parameter> params)
Sets the list of parameters involved in this constraint.
|
void |
setText(java.lang.String text)
Sets the text of this constraint.
|
java.lang.String |
toString()
Returns a string representation of this constraint.
|
public Constraint(java.lang.String text,
java.util.ArrayList<Parameter> params)
text - the text of this constraintparams - all the parameters involved in this constraintpublic java.lang.String getText()
public void setText(java.lang.String text)
text - public java.util.ArrayList<Parameter> getParams()
public void setParams(java.util.ArrayList<Parameter> params)
params - public edu.uta.cse.fireeye.service.constraint.HiddenParameterHelper getHiddenParameterHelper()
public boolean involved(Parameter param)
This method is needed to construct a constraint graph.
param - public boolean eval(int[] test)
Note that if one or more parameters have a DONT_CARE value in the test, the constraint is considered to be satisfied. The assumption is that a constraint must be satisfiable. Otherwise, it should not be entered in the first place. Theoretically speaking, it should try all possible values of these parameter to make sure the constraint can be truly satisfied.
public boolean eval(edu.uta.cse.fireeye.service.engine.Tuple tuple)
Note that if one or more parameters in the constraint do not appear in the tuple, the constraint is considered to be satisfied.
public boolean eval(edu.uta.cse.fireeye.service.engine.PVPair p1,
edu.uta.cse.fireeye.service.engine.PVPair p2)
This method is only used in building the constraint graph, where p1 and p2 should represent the parameters involved in this constraint.
public boolean eval(edu.uta.cse.fireeye.service.engine.PVPair p)
public java.lang.Object convert(Parameter param, int index)
param - index - public Parameter getHiddenParameter()
public java.lang.String toString()
toString in class java.lang.Object