|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hssf.usermodel.DVConstraint
public class DVConstraint
Nested Class Summary | |
---|---|
static class |
DVConstraint.FormulaPair
|
Nested classes/interfaces inherited from interface org.apache.poi.ss.usermodel.DataValidationConstraint |
---|
DataValidationConstraint.OperatorType, DataValidationConstraint.ValidationType |
Method Summary | |
---|---|
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. |
java.lang.String[] |
getExplicitListValues()
|
java.lang.String |
getFormula1()
|
java.lang.String |
getFormula2()
|
int |
getOperator()
|
int |
getValidationType()
|
java.lang.Double |
getValue1()
|
java.lang.Double |
getValue2()
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |