Package org.zkoss.zul
Class SimpleDoubleSpinnerConstraint
- java.lang.Object
-
- org.zkoss.zul.SimpleConstraint
-
- org.zkoss.zul.SimpleDoubleSpinnerConstraint
-
- All Implemented Interfaces:
java.io.Serializable
,ClientConstraint
,Constraint
public class SimpleDoubleSpinnerConstraint extends SimpleConstraint
A simple double spinner constraint.- Since:
- 5.0.6
- Author:
- jumperchen
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.zul.SimpleConstraint
_finishParseCst, _flags, AFTER_END, AFTER_POINTER, AFTER_START, AT_POINTER, BEFORE_END, BEFORE_START, END_AFTER, END_BEFORE, NO_EMPTY, NO_FUTURE, NO_NEGATIVE, NO_PAST, NO_POSITIVE, NO_TODAY, NO_ZERO, OVERLAP, OVERLAP_AFTER, OVERLAP_BEFORE, OVERLAP_END, SERVER, START_AFTER, START_BEFORE, STRICT
-
-
Constructor Summary
Constructors Constructor Description SimpleDoubleSpinnerConstraint()
Constraints a constraint.SimpleDoubleSpinnerConstraint(int flags)
Constraints a constraint.SimpleDoubleSpinnerConstraint(java.lang.String constraint)
Constructs a constraint with a list of constraints separated by comma.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Double
getMax()
Returns the maximum value.java.lang.Double
getMin()
Returns the minimum value.protected int
parseConstraint(java.lang.String constraint)
Parses a constraint into an integer value.void
setMax(java.lang.Double max)
Set the maximum value.void
setMin(java.lang.Double min)
Set the minimum value.void
validate(Component comp, java.lang.Object value)
Verifies whether the value is acceptable.-
Methods inherited from class org.zkoss.zul.SimpleConstraint
getClientConstraint, getClientPackages, getErrorMessage, getFlags, getInstance, getRawValue
-
-
-
-
Constructor Detail
-
SimpleDoubleSpinnerConstraint
public SimpleDoubleSpinnerConstraint()
Constraints a constraint.
-
SimpleDoubleSpinnerConstraint
public SimpleDoubleSpinnerConstraint(int flags)
Constraints a constraint.- Parameters:
flags
- a combination ofSimpleConstraint.NO_POSITIVE
,SimpleConstraint.NO_NEGATIVE
,SimpleConstraint.NO_ZERO
, and so on.
-
SimpleDoubleSpinnerConstraint
public SimpleDoubleSpinnerConstraint(java.lang.String constraint)
Constructs a constraint with a list of constraints separated by comma.- Parameters:
constraint
- a list of constraints separated by comma. Example: no positive, no zero
-
-
Method Detail
-
getMin
public java.lang.Double getMin()
Returns the minimum value.
-
setMin
public void setMin(java.lang.Double min)
Set the minimum value.
-
getMax
public java.lang.Double getMax()
Returns the maximum value.
-
setMax
public void setMax(java.lang.Double max)
Set the maximum value.
-
parseConstraint
protected int parseConstraint(java.lang.String constraint) throws UiException
Description copied from class:SimpleConstraint
Parses a constraint into an integer value. For example, "no positive" is parsed toSimpleConstraint.NO_POSITIVE
.Deriving classes might override this to provide more constraints.
- Overrides:
parseConstraint
in classSimpleConstraint
- Throws:
UiException
-
validate
public void validate(Component comp, java.lang.Object value) throws WrongValueException
Description copied from interface:Constraint
Verifies whether the value is acceptable.- Specified by:
validate
in interfaceConstraint
- Overrides:
validate
in classSimpleConstraint
- Parameters:
comp
- the component being validated- Throws:
WrongValueException
-
-