|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.app.AdminExpressionVariable
public class AdminExpressionVariable
An expression variable is part of an expression
Field Summary | |
---|---|
static int |
AND
Expression type. |
private int |
andOr
Defines whether this variable has to be ANDed or ORed with the one that precedes it. |
private int |
customerTagId
Id of the customer tag for this variable |
private java.lang.String |
customerValue
The customer value for the tag which is compared to the value attribute when
evaluating the expression variable. |
static int |
EQUAL
Comparison type. |
private int |
expressionId
Id of the expression that this variable belongs to |
static int |
GREATER_EQUAL
Comparison type. |
static int |
GREATER_THAN
Comparison type. |
private int |
groupAndOr
Defines whether this group has to be ANDed or ORed with the one that precedes it. |
private int |
groupOrder
The order of the group that this expression variable belongs to. |
private int |
id
id |
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. |
private int |
operator
Valid operators are: AdminExpressionVariable.EQUAL AdminExpressionVariable.NOT_EQUAL AdminExpressionVariable.GREATER_EQUAL AdminExpressionVariable.GREATER_THAN AdminExpressionVariable.LESS_EQUAL AdminExpressionVariable.LESS_THAN AdminExpressionVariable.MATCH - Used to match regular expression Note that not all operators are valid for all tag types. |
static int |
OR
Expression type. |
private int |
order
The order of this expression variable. |
private int |
type
The type of variable. |
private java.lang.String |
value
The value of the expression variable. |
Constructor Summary | |
---|---|
AdminExpressionVariable()
Constructor |
|
AdminExpressionVariable(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 |
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 AdminCustomerTag.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()
|
int |
getCustomerTagId()
|
java.lang.String |
getCustomerValue()
|
int |
getExpressionId()
|
int |
getGroupAndOr()
|
int |
getGroupOrder()
|
int |
getId()
|
int |
getOperator()
|
protected java.lang.String |
getOperatorName(int oper)
Returns the name of the operator mainly for reporting purposes. |
int |
getOrder()
|
int |
getType()
|
java.lang.String |
getValue()
|
void |
setAndOr(int andOr)
|
void |
setCustomerTagId(int customerTagId)
|
void |
setCustomerValue(java.lang.String customerValue)
|
void |
setExpressionId(int expressionId)
|
void |
setGroupAndOr(int groupAndOr)
|
void |
setGroupOrder(int groupOrder)
|
void |
setId(int id)
|
void |
setOperator(int operator)
|
void |
setOrder(int order)
|
void |
setType(int type)
|
void |
setValue(java.lang.String value)
|
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
private int id
private int customerTagId
private int expressionId
private int type
AdminCustomerTag.STRING_TYPE
: The value is a StringAdminCustomerTag.INT_TYPE
: The value is an integerAdminCustomerTag.MULTI_INT_TYPE
: The value contains one or more integers
separated by a delimiter. The maxInts
attributes determines how many integers
are allowed.AdminCustomerTag.DECIMAL_TYPE
: The value is a decimal.AdminCustomerTag.DATE_TYPE
: The value is a date.AdminCustomerTag.BOOLEAN_TYPE
: The value is a boolean and so must contain
the string true
or false
AdminCustomerTag.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.
private int operator
private java.lang.String value
private java.lang.String customerValue
value
attribute when
evaluating the expression variable.
private int order
private int andOr
private int groupOrder
private int groupAndOr
Constructor Detail |
---|
public AdminExpressionVariable()
public AdminExpressionVariable(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 java.lang.String toString()
toString
in interface AdminObjectIf
toString
in class java.lang.Object
public boolean evaluate() throws KKAdminException
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:
KKAdminException
protected boolean compareStrings(int oper) throws KKAdminException
oper
-
KKAdminException
protected boolean compareBooleans(int oper) throws KKAdminException
oper
-
KKAdminException
protected boolean compareMultiInt(int oper) throws KKAdminException
oper
-
KKAdminException
protected boolean compareInts(int oper) throws KKAdminException
oper
-
KKAdminException
protected boolean compareDates(int oper) throws KKAdminException
oper
-
KKAdminException
protected boolean compareAge(int oper) throws KKAdminException
oper
-
KKAdminException
protected boolean compareDecimals(int oper) throws KKAdminException
oper
-
KKAdminException
protected java.lang.String getOperatorName(int oper)
oper
-
public int getId()
getId
in interface AdminObjectIf
public void setId(int id)
setId
in interface AdminObjectIf
id
- the id to setpublic int getCustomerTagId()
public void setCustomerTagId(int customerTagId)
customerTagId
- the customerTagId to setpublic int getExpressionId()
public void setExpressionId(int expressionId)
expressionId
- the expressionId to setpublic int getType()
public void setType(int type)
type
- the type to setpublic int getOperator()
public void setOperator(int operator)
operator
- the operator to setpublic java.lang.String getValue()
public void setValue(java.lang.String value)
value
- the value to setpublic int getOrder()
public void setOrder(int order)
order
- the order to setpublic int getAndOr()
public void setAndOr(int andOr)
andOr
- the andOr to setpublic int getGroupOrder()
public void setGroupOrder(int groupOrder)
groupOrder
- the groupOrder to setpublic int getGroupAndOr()
public void setGroupAndOr(int groupAndOr)
groupAndOr
- the groupAndOr to setpublic java.lang.String getCustomerValue()
public void setCustomerValue(java.lang.String customerValue)
customerValue
- the customerValue to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |