public class ExpressionVariable extends java.lang.Object implements ExpressionVariableIf
| Modifier and Type | Field and Description |
|---|---|
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 |
N_A
Tag value not available
|
static int |
NOT_EQUAL
Comparison type.
|
static int |
OR
Expression type.
|
| Constructor and Description |
|---|
ExpressionVariable()
Constructor
|
ExpressionVariable(com.workingdogs.village.Record vr,
KKCriteria c)
Instantiates the attributes of the Tag object from a Record object
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
compareAge(int oper)
The value attribute is the age in seconds.
|
protected boolean |
compareBooleans(int oper)
Compare Booleans
|
protected boolean |
compareDates(int oper)
Compare dates which are stored as strings containing the millisecond value
|
protected boolean |
compareDecimals(int oper)
Compare decimals
|
protected boolean |
compareInts(int oper)
Compare integers
|
protected boolean |
compareMultiInt(int oper)
Compare Multi ints which are stored as integers separated by CustomerTag.DELIM
|
protected boolean |
compareMultiIntPlusTime(int oper)
Compare Multi ints which are stored as integer and timestamp pairs separated by
CustomerTag.DELIM.
|
protected boolean |
compareStrings(int oper)
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 oper)
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() |
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 N_A
public static final int AND
public static final int OR
public ExpressionVariable()
public ExpressionVariable(com.workingdogs.village.Record vr,
KKCriteria c)
throws com.workingdogs.village.DataSetException
vr - Record containing datac - Criteria containing column namescom.workingdogs.village.DataSetException - an unexpected exception due to data in Torque (the database layer)public boolean evaluate()
throws com.konakart.app.KKException
value attribute with the
customerValue attribute using the operator attribute. False is
returned if any of the values are null.
Not all operators are valid for all customer tag types. The valid operators for each customer tag type are:
KKException - an unexpected KKException exceptionprotected boolean compareStrings(int oper)
throws com.konakart.app.KKException
oper - the operKKException - an unexpected KKException exceptionprotected boolean compareBooleans(int oper)
throws com.konakart.app.KKException
oper - the operKKException - an unexpected KKException exceptionprotected boolean compareMultiInt(int oper)
throws com.konakart.app.KKException
oper - the operKKException - an unexpected KKException exceptionprotected boolean compareMultiIntPlusTime(int oper)
throws com.konakart.app.KKException
oper - the operKKException - an unexpected KKException exceptionprotected boolean compareInts(int oper)
throws com.konakart.app.KKException
oper - the operKKException - an unexpected KKException exceptionprotected boolean compareDates(int oper)
throws com.konakart.app.KKException
oper - the operKKException - an unexpected KKException exceptionprotected boolean compareAge(int oper)
throws com.konakart.app.KKException
oper - the operKKException - an unexpected KKException exceptionprotected boolean compareDecimals(int oper)
throws com.konakart.app.KKException
oper - the operKKException - an unexpected KKException exceptionprotected java.lang.String getOperatorName(int oper)
oper - the operpublic 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()
ExpressionVariableIfgetCustomerTagId in interface ExpressionVariableIfpublic void setCustomerTagId(int customerTagId)
ExpressionVariableIfsetCustomerTagId in interface ExpressionVariableIfcustomerTagId - the customerTagId to setpublic int getExpressionId()
ExpressionVariableIfgetExpressionId in interface ExpressionVariableIfpublic void setExpressionId(int expressionId)
ExpressionVariableIfsetExpressionId 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.MULTI_INT_PLUS_TIME_TYPE: The tag value contains one or more integer and
timestamp pairs separated by a delimiter. The maxInts attributes determines how
many integers are allowed. The integer and timestamp are separated by a space character. The
timestamp is the number of milliseconds since 1st January 1970 (Epoch time)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 falseCustomerTag.AGE_TYPE: The tag value is a date. When creating expressions you
can define the value to be greater or less than a length of time (in seconds) rather than
comparing it to a specific date.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.MULTI_INT_PLUS_TIME_TYPE: The tag value contains one or more integer and
timestamp pairs separated by a delimiter. The maxInts attributes determines how
many integers are allowed. The integer and timestamp are separated by a space character. The
timestamp is the number of milliseconds since 1st January 1970 (Epoch time)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 falseCustomerTag.AGE_TYPE: The tag value is a date. When creating expressions you
can define the value to be greater or less than a length of time (in seconds) rather than
comparing it to a specific date.setType in interface ExpressionVariableIftype - the type to setpublic int getOperator()
ExpressionVariableIfgetOperator in interface ExpressionVariableIfpublic void setOperator(int operator)
ExpressionVariableIfsetOperator in interface ExpressionVariableIfoperator - the operator to setpublic java.lang.String getValue()
ExpressionVariableIfgetValue in interface ExpressionVariableIfpublic void setValue(java.lang.String value)
ExpressionVariableIfsetValue 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()
ExpressionVariableIfgetOrder in interface ExpressionVariableIfpublic void setOrder(int order)
ExpressionVariableIfsetOrder in interface ExpressionVariableIforder - the order to setpublic int getAndOr()
ExpressionVariableIfgetAndOr in interface ExpressionVariableIfpublic void setAndOr(int andOr)
ExpressionVariableIfsetAndOr in interface ExpressionVariableIfandOr - the andOr to setpublic int getGroupOrder()
ExpressionVariableIfgetGroupOrder in interface ExpressionVariableIfpublic void setGroupOrder(int groupOrder)
ExpressionVariableIfsetGroupOrder in interface ExpressionVariableIfgroupOrder - the groupOrder to setpublic int getGroupAndOr()
ExpressionVariableIfgetGroupAndOr in interface ExpressionVariableIfpublic void setGroupAndOr(int groupAndOr)
ExpressionVariableIfsetGroupAndOr in interface ExpressionVariableIfgroupAndOr - the groupAndOr to setCopyright © 2018 DS Data Systems UK Ltd.