java.lang.Object | +--com.ibm.commerce.condition.Condition | +--com.ibm.commerce.condition.SimpleCondition
This class describes a simple condition boolean expression. A simple condition consists of a variable, an operator, and a value with optional qualifiers.
Nested Class Summary | |
---|---|
static class |
SimpleCondition.Qualifier This class describes a simple condition qualifier. |
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT Copyright. |
Constructor Summary | |
---|---|
SimpleCondition(java.lang.String variable, java.lang.String operator,
java.lang.String value) This constructor takes the variable name, the operator and the value for the simple condition. | |
SimpleCondition(java.lang.String variable, java.lang.String operator,
java.lang.String value,
SimpleCondition.Qualifier qualifier) This constructor takes the variable name, the operator, the value and a single qualifier for the simple condition. | |
SimpleCondition(java.lang.String variable, java.lang.String operator,
java.lang.String value,
SimpleCondition.Qualifier[] qualifiers) This constructor takes the variable name, the operator, the value and an array of qualifiers for the simple condition. |
Method Summary | |
---|---|
java.lang.Object |
clone() Returns a clone of this condition object. |
boolean |
evaluate(
Evaluator evaluator) This method evaluates the simple condition. |
java.lang.String |
getOperator() Gets the operator name. |
SimpleCondition.Qualifier[] |
getQualifiers() Gets the array of qualifiers. |
java.lang.String |
getValue() Gets the value. |
java.lang.String |
getVariable() Gets the variable name. |
void |
setOperator(java.lang.String operator) Sets the operator name. |
void |
setQualifiers(
SimpleCondition.Qualifier[] qualifiers) Sets the array of qualifiers. |
void |
setValue(java.lang.String value) Sets the value name. |
void |
setVariable(java.lang.String variable) Sets the variable name. |
Methods inherited from class com.ibm.commerce.condition. Condition |
getNot,
getType,
getXMLFragment,
loadConditionFromXML,
setNot,
setType |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString,
wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public SimpleCondition(java.lang.String variable, java.lang.String operator, java.lang.String value)
variable
- The variable name.operator
- The operator name.value
- The value.public SimpleCondition(java.lang.String variable, java.lang.String operator, java.lang.String value, SimpleCondition.Qualifier qualifier)
variable
- The variable name.operator
- The operator name.value
- The value.qualifier
- A qualifier for this simple condition.public SimpleCondition(java.lang.String variable, java.lang.String operator, java.lang.String value, SimpleCondition.Qualifier[] qualifiers)
variable
- The variable name.operator
- The operator name.value
- The value.qualifiers
- An array of Qualifier objects.Method Detail |
---|
public java.lang.Object clone()
Condition
clone
in class
Condition
public java.lang.String getVariable()
public void setVariable(java.lang.String variable)
variable
- The variable name.public java.lang.String getOperator()
public void setOperator(java.lang.String operator)
operator
- The operator name.public java.lang.String getValue()
public void setValue(java.lang.String value)
value
- The value.public SimpleCondition.Qualifier[] getQualifiers()
public void setQualifiers(SimpleCondition.Qualifier[] qualifiers)
qualifiers
- An array of qualifier
objects.public boolean evaluate(Evaluator evaluator)
not
property is true
.
evaluate
in class
Condition
evaluator
- An implementation of the Evaluator interface that
is used to evaluate the simple conditions.true
if the condition is true.