public class DVConstraint extends java.lang.Object implements DataValidationConstraint
Modifier and Type | Class and Description |
---|---|
static class |
DVConstraint.FormulaPair |
DataValidationConstraint.OperatorType, DataValidationConstraint.ValidationType
Modifier and Type | Method and Description |
---|---|
static DVConstraint |
createCustomFormulaConstraint(java.lang.String formula) |
static DVConstraint |
createDateConstraint(int comparisonOperator,
java.lang.String expr1,
java.lang.String expr2,
java.lang.String dateFormat)
Creates a date based data validation constraint.
|
static DVConstraint |
createExplicitListConstraint(java.lang.String[] explicitListValues) |
static DVConstraint |
createFormulaListConstraint(java.lang.String listFormula) |
static DVConstraint |
createNumericConstraint(int validationType,
int comparisonOperator,
java.lang.String expr1,
java.lang.String expr2)
Creates a number based data validation constraint.
|
static DVConstraint |
createTimeConstraint(int comparisonOperator,
java.lang.String expr1,
java.lang.String expr2)
Creates a time based data validation constraint.
|
boolean |
equals(java.lang.Object other) |
java.lang.String[] |
getExplicitListValues() |
java.lang.String |
getFormula1() |
java.lang.String |
getFormula2() |
int |
getOperator() |
int |
getValidationType() |
java.lang.Double |
getValue1() |
java.lang.Double |
getValue2() |
int |
hashCode() |
boolean |
isExplicitList()
Convenience method
|
boolean |
isListValidationType()
Convenience method
|
void |
setExplicitListValues(java.lang.String[] explicitListValues) |
void |
setFormula1(java.lang.String formula1)
Sets a formula for expression 1.
|
void |
setFormula2(java.lang.String formula2)
Sets a formula for expression 2.
|
void |
setOperator(int operator)
Sets the comparison operator for this constraint
|
void |
setValue1(double value1)
Sets a numeric value for expression 1.
|
void |
setValue2(double value2)
Sets a numeric value for expression 2.
|
public static DVConstraint createNumericConstraint(int validationType, int comparisonOperator, java.lang.String expr1, java.lang.String expr2)
validationType
- one of DataValidationConstraint.ValidationType.ANY
,
DataValidationConstraint.ValidationType.DECIMAL
,
DataValidationConstraint.ValidationType.INTEGER
,
DataValidationConstraint.ValidationType.TEXT_LENGTH
comparisonOperator
- any constant from DataValidationConstraint.OperatorType
enumexpr1
- date formula (when first char is '=') or formatted number valueexpr2
- date formula (when first char is '=') or formatted number valuepublic static DVConstraint createFormulaListConstraint(java.lang.String listFormula)
public static DVConstraint createExplicitListConstraint(java.lang.String[] explicitListValues)
public static DVConstraint createTimeConstraint(int comparisonOperator, java.lang.String expr1, java.lang.String expr2)
comparisonOperator
- constant from DataValidationConstraint.OperatorType
enumexpr1
- date formula (when first char is '=') or formatted time valueexpr2
- date formula (when first char is '=') or formatted time valuepublic static DVConstraint createDateConstraint(int comparisonOperator, java.lang.String expr1, java.lang.String expr2, java.lang.String dateFormat)
comparisonOperator
- constant from DataValidationConstraint.OperatorType
enumexpr1
- date formula (when first char is '=') or formatted date valueexpr2
- date formula (when first char is '=') or formatted date valuedateFormat
- ignored if both expr1 and expr2 are formulas. Default value is "YYYY/MM/DD"
otherwise any other valid argument for SimpleDateFormat can be usedpublic static DVConstraint createCustomFormulaConstraint(java.lang.String formula)
public int getValidationType()
getValidationType
in interface DataValidationConstraint
DataValidationConstraint.ValidationType
public boolean isListValidationType()
true
if this constraint is a 'list' validationpublic boolean isExplicitList()
true
if this constraint is a 'list' validation with explicit valuespublic int getOperator()
getOperator
in interface DataValidationConstraint
DataValidationConstraint.OperatorType
public void setOperator(int operator)
DataValidationConstraint
setOperator
in interface DataValidationConstraint
DataValidationConstraint.OperatorType
public java.lang.String[] getExplicitListValues()
getExplicitListValues
in interface DataValidationConstraint
public void setExplicitListValues(java.lang.String[] explicitListValues)
setExplicitListValues
in interface DataValidationConstraint
public java.lang.String getFormula1()
getFormula1
in interface DataValidationConstraint
null
public void setFormula1(java.lang.String formula1)
DataValidationConstraint
setFormula1
in interface DataValidationConstraint
public java.lang.String getFormula2()
getFormula2
in interface DataValidationConstraint
null
public void setFormula2(java.lang.String formula2)
DataValidationConstraint
setFormula2
in interface DataValidationConstraint
public java.lang.Double getValue1()
null
public void setValue1(double value1)
public java.lang.Double getValue2()
null
public void setValue2(double value2)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
Copyright © 2005-2010 Potix Corporation. All Rights Reserved.