|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.konakart.app.ExpressionVariable
public class ExpressionVariable
An expression variable is part of an expression
| Field Summary | |
|---|---|
static int |
AND
Expression type. |
static int |
EQUAL
Comparison type. |
static int |
GREATER_EQUAL
Comparison type. |
static int |
GREATER_THAN
Comparison type. |
static int |
LESS_EQUAL
Comparison type. |
static int |
LESS_THAN
Comparison type. |
static int |
MATCH
Comparison type to match regular expression |
static int |
NOT_EQUAL
Comparison type. |
static int |
OR
Expression type. |
| Constructor Summary | |
|---|---|
ExpressionVariable()
Constructor |
|
ExpressionVariable(com.workingdogs.village.Record vr,
org.apache.torque.util.Criteria c)
Instantiates the attributes of the Tag object from a Record object |
|
| Method Summary | |
|---|---|
protected boolean |
compareBooleans(int operator)
Compare Booleans |
protected boolean |
compareDates(int operator)
Compare dates which are stored as strings containing the millisecond value |
protected boolean |
compareDecimals(int operator)
Compare decimals |
protected boolean |
compareInts(int operator)
Compare integers |
protected boolean |
compareMultiInt(int operator)
Compare Multi ints which are stored as integers separated by CustomerTag.DELIM |
protected boolean |
compareStrings(int operator)
Compare strings |
boolean |
evaluate()
Evaluates the variable by comparing the value attribute with the
customerValue attribute using the operator attribute. |
int |
getAndOr()
Defines whether this variable has to be ANDed or ORed with the one that precedes it. |
int |
getCustomerTagId()
Id of the customer tag for this variable |
java.lang.String |
getCustomerValue()
The customer value for the tag which is compared to the value attribute when
evaluating the expression variable. |
int |
getExpressionId()
Id of the expression that this variable belongs to |
int |
getGroupAndOr()
Defines whether this group has to be ANDed or ORed with the one that precedes it. |
int |
getGroupOrder()
The order of the group that this expression variable belongs to. |
int |
getId()
|
int |
getOperator()
Valid operators are: ExpressionVariable.EQUAL ExpressionVariable.NOT_EQUAL ExpressionVariable.GREATER_EQUAL ExpressionVariable.GREATER_THAN ExpressionVariable.LESS_EQUAL ExpressionVariable.LESS_THAN ExpressionVariable.MATCH - Used to match regular expression Note that not all operators are valid for all tag types. |
protected java.lang.String |
getOperatorName(int operator)
Returns the name of the operator mainly for reporting purposes. |
int |
getOrder()
The order of this expression variable. |
int |
getType()
The type of variable. |
java.lang.String |
getValue()
The value of the expression variable. |
void |
setAndOr(int andOr)
Defines whether this variable has to be ANDed or ORed with the one that precedes it. |
void |
setCustomerTagId(int customerTagId)
Id of the customer tag for this variable |
void |
setCustomerValue(java.lang.String customerValue)
The customer value for the tag which is compared to the value attribute when
evaluating the expression variable. |
void |
setExpressionId(int expressionId)
Id of the expression that this variable belongs to |
void |
setGroupAndOr(int groupAndOr)
Defines whether this group has to be ANDed or ORed with the one that precedes it. |
void |
setGroupOrder(int groupOrder)
The order of the group that this expression variable belongs to. |
void |
setId(int id)
|
void |
setOperator(int operator)
Valid operators are: ExpressionVariable.EQUAL ExpressionVariable.NOT_EQUAL ExpressionVariable.GREATER_EQUAL ExpressionVariable.GREATER_THAN ExpressionVariable.LESS_EQUAL ExpressionVariable.LESS_THAN ExpressionVariable.MATCH - Used to match regular expression Note that not all operators are valid for all tag types. |
void |
setOrder(int order)
The order of this expression variable. |
void |
setType(int type)
The type of variable. |
void |
setValue(java.lang.String value)
The value of the expression variable. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int EQUAL
public static final int NOT_EQUAL
public static final int GREATER_THAN
public static final int LESS_THAN
public static final int GREATER_EQUAL
public static final int LESS_EQUAL
public static final int MATCH
public static final int AND
public static final int OR
| Constructor Detail |
|---|
public ExpressionVariable()
public ExpressionVariable(com.workingdogs.village.Record vr,
org.apache.torque.util.Criteria c)
throws com.workingdogs.village.DataSetException
vr - Record containing datac - Criteria containing column names
com.workingdogs.village.DataSetException| Method Detail |
|---|
public boolean evaluate()
throws KKException
value attribute with the
customerValue attribute using the operator attribute. False is
returned if any of the values are null.
KKException
protected boolean compareStrings(int operator)
throws KKException
operator -
KKException
protected boolean compareBooleans(int operator)
throws KKException
operator -
KKException
protected boolean compareMultiInt(int operator)
throws KKException
operator -
KKException
protected boolean compareInts(int operator)
throws KKException
operator -
KKException
protected boolean compareDates(int operator)
throws KKException
operator -
KKException
protected boolean compareDecimals(int operator)
throws KKException
operator -
KKExceptionprotected java.lang.String getOperatorName(int operator)
operator -
public java.lang.String toString()
toString in class java.lang.Objectpublic int getId()
getId in interface ExpressionVariableIfpublic void setId(int id)
setId in interface ExpressionVariableIfid - the id to setpublic int getCustomerTagId()
ExpressionVariableIf
getCustomerTagId in interface ExpressionVariableIfpublic void setCustomerTagId(int customerTagId)
ExpressionVariableIf
setCustomerTagId in interface ExpressionVariableIfcustomerTagId - the customerTagId to setpublic int getExpressionId()
ExpressionVariableIf
getExpressionId in interface ExpressionVariableIfpublic void setExpressionId(int expressionId)
ExpressionVariableIf
setExpressionId in interface ExpressionVariableIfexpressionId - the expressionId to setpublic int getType()
ExpressionVariableIfCustomerTag.STRING_TYPE: The value is a StringCustomerTag.INT_TYPE: The value is an integerCustomerTag.MULTI_INT_TYPE: The value contains one or more integers
separated by a delimiter. The maxInts attributes determines how many integers
are allowed.CustomerTag.DECIMAL_TYPE: The value is a decimal.CustomerTag.DATE_TYPE: The value is a date.CustomerTag.BOOLEAN_TYPE: The value is a boolean and so must contain the
string true or false
getType in interface ExpressionVariableIfpublic void setType(int type)
ExpressionVariableIfCustomerTag.STRING_TYPE: The value is a StringCustomerTag.INT_TYPE: The value is an integerCustomerTag.MULTI_INT_TYPE: The value contains one or more integers
separated by a delimiter. The maxInts attributes determines how many integers
are allowed.CustomerTag.DECIMAL_TYPE: The value is a decimal.CustomerTag.DATE_TYPE: The value is a date.CustomerTag.BOOLEAN_TYPE: The value is a boolean and so must contain the
string true or false
setType in interface ExpressionVariableIftype - the type to setpublic int getOperator()
ExpressionVariableIf
getOperator in interface ExpressionVariableIfpublic void setOperator(int operator)
ExpressionVariableIf
setOperator in interface ExpressionVariableIfoperator - the operator to setpublic java.lang.String getValue()
ExpressionVariableIf
getValue in interface ExpressionVariableIfpublic void setValue(java.lang.String value)
ExpressionVariableIf
setValue in interface ExpressionVariableIfvalue - the value to setpublic java.lang.String getCustomerValue()
ExpressionVariableIfvalue attribute when
evaluating the expression variable.
getCustomerValue in interface ExpressionVariableIfpublic void setCustomerValue(java.lang.String customerValue)
ExpressionVariableIfvalue attribute when
evaluating the expression variable.
setCustomerValue in interface ExpressionVariableIfcustomerValue - the customerValue to setpublic int getOrder()
ExpressionVariableIf
getOrder in interface ExpressionVariableIfpublic void setOrder(int order)
ExpressionVariableIf
setOrder in interface ExpressionVariableIforder - the order to setpublic int getAndOr()
ExpressionVariableIf
getAndOr in interface ExpressionVariableIfpublic void setAndOr(int andOr)
ExpressionVariableIf
setAndOr in interface ExpressionVariableIfandOr - the andOr to setpublic int getGroupOrder()
ExpressionVariableIf
getGroupOrder in interface ExpressionVariableIfpublic void setGroupOrder(int groupOrder)
ExpressionVariableIf
setGroupOrder in interface ExpressionVariableIfgroupOrder - the groupOrder to setpublic int getGroupAndOr()
ExpressionVariableIf
getGroupAndOr in interface ExpressionVariableIfpublic void setGroupAndOr(int groupAndOr)
ExpressionVariableIf
setGroupAndOr in interface ExpressionVariableIfgroupAndOr - the groupAndOr to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||