|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.models.BoundedDouble
public class BoundedDouble
A BoundedDouble is an implementation of BoundedNumberInterface. It stores a double value between a range of doubles, with a value for the default increment.
BoundedNumberInterface,
Serialized Form| Field Summary | |
|---|---|
protected static int |
INVALID_FORMAT
|
static java.lang.String |
invalidFormat
|
protected static OrderedCollection |
messages
|
protected static int |
ONLY_VALIDATE_STRING
|
static java.lang.String |
onlyValidateString
|
static java.lang.String |
RB_KEY
|
protected java.lang.String |
validationMessageCode
|
protected static int |
VALUE_ABOVE_MAX
|
protected static int |
VALUE_BELOW_MIN
|
static java.lang.String |
valueAboveMax
|
static java.lang.String |
valueBelowMin
|
| Fields inherited from interface com.sas.models.IncrementInterface |
|---|
BLOCK, UNIT |
| Constructor Summary | |
|---|---|
BoundedDouble()
Default constructor. |
|
BoundedDouble(double value,
double min,
double max)
|
|
BoundedDouble(double value,
double min,
double max,
double unit,
double block)
Creates an double range with the specified value, unitIncrement, blockIncrement, minimum, and maximum amounts. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clone an BoundedDouble object |
void |
createValidationMessages()
|
boolean |
equals(BoundedDouble otherRange)
Compare to an BoundedDouble object. |
boolean |
equals(java.lang.Object object)
Compare to an object. |
double |
getBlockIncrement()
Gets the block value increment for the adjustable object. |
java.lang.Number |
getBlockIncrementNumber()
Gets the block value increment for the adjustable object. |
double |
getDoubleData()
|
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
|
double |
getMaximum()
Gets the maximum value of the adjustable object. |
java.lang.Number |
getMaximumNumber()
Gets the maximum value of the double range. |
double |
getMinimum()
Gets the minimum value of the adjustable object. |
java.lang.Number |
getMinimumNumber()
Gets the minimum value of the double range. |
java.lang.Number |
getNumberValue()
Gets the current value of the adjustable object. |
double |
getUnitIncrement()
Gets the unit value increment for the adjustable object. |
java.lang.Number |
getUnitIncrementNumber()
Gets the unit value increment for the adjustable object. |
com.sas.text.Message |
getValidationMessage()
Returns the validation message set when validateValue() last returned false. |
java.lang.String |
getValidationMessageCode()
Returns the validation message code set when validateValue() last returned false. |
double |
getValue()
Gets the current value of the adjustable object. |
java.lang.Number |
incrementBy(int increment,
int incrementType)
Increment, by unit or block increment amount, the current value by the specified number of increments. |
com.sas.text.Message |
newValidationMessage(java.lang.String template)
|
java.lang.Object |
normalizeValue(java.lang.Object component,
java.lang.Object value)
Allows the validator to modify the value after it has been deemed valid. |
void |
setBlockIncrement(double block)
Sets the block value increment for the adjustable object. |
void |
setBlockIncrementNumber(java.lang.Number block)
Sets the block value increment for the adjustable object. |
void |
setDefaultValues()
Set the default values of all the attributes |
void |
setDoubleData(double newValue)
|
void |
setMaximum(double max)
Sets the maximum value of the adjustable object. |
void |
setMaximumNumber(java.lang.Number max)
Sets the maximum value of the adjustable object. |
void |
setMinimum(double min)
Sets the minimum value of the adjustable object. |
void |
setMinimumNumber(java.lang.Number min)
Sets the minimum value of the adjustable object. |
void |
setNumberValue(java.lang.Number newValue)
Sets the current value of the adjustable object. |
void |
setNumberValues(java.lang.Number newValue,
java.lang.Number min,
java.lang.Number max)
Set the value, minimum and maximum at the same time. |
void |
setNumberValues(java.lang.Number newValue,
java.lang.Number min,
java.lang.Number max,
java.lang.Number unit,
java.lang.Number block)
Set the value, minimum, maximum, unitIncrement, and blockIncrement at the same time. |
void |
setUnitIncrement(double unit)
Sets the unit value increment for the adjustable object. |
void |
setUnitIncrementNumber(java.lang.Number unit)
Sets the unit value increment for the adjustable object. |
void |
setValidationMessage(com.sas.text.Message message)
Sets the validation message which indicates why validateValue() returned false. |
void |
setValidationMessageCode(java.lang.String code)
|
void |
setValue(double newValue)
Sets the current value of the adjustable object. |
void |
setValues(double value,
double min,
double max)
Set the value, minimum and maximum at the same time. |
void |
setValues(double value,
double min,
double max,
double unit,
double block)
Set the value, minimum and maximum at the same time. |
java.lang.String |
toString()
Return a string representation of an BoundedDouble |
boolean |
validateValue(java.lang.Object component,
java.lang.Object value)
Validates the value passed in (possibly) based on information from the component passed in. |
| Field Detail |
|---|
public static final java.lang.String RB_KEY
protected java.lang.String validationMessageCode
protected static OrderedCollection messages
public static final java.lang.String valueBelowMin
public static final java.lang.String valueAboveMax
public static final java.lang.String invalidFormat
public static final java.lang.String onlyValidateString
protected static final int VALUE_BELOW_MIN
protected static final int VALUE_ABOVE_MAX
protected static final int INVALID_FORMAT
protected static final int ONLY_VALIDATE_STRING
| Constructor Detail |
|---|
public BoundedDouble()
public BoundedDouble(double value,
double min,
double max)
public BoundedDouble(double value,
double min,
double max,
double unit,
double block)
value - initial value. If value < min it is set to min;
if value > max, it is set to maxmin - minimum valuemax - maximum valueunit - unit incrementblock - block increment
java.lang.IllegalArgumentException - if (min > max), (unit < 0),
(block < 0), (unit > range) or (block > range),
where range = (max - min)| Method Detail |
|---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - another object
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface com.sas.PublicClonableclone in class Componentjava.lang.CloneNotSupportedException - if there is a clone exception.public boolean equals(BoundedDouble otherRange)
otherRange - another BoundedDouble object
public java.lang.String toString()
toString in class java.lang.Objectpublic void setDefaultValues()
setDefaultValues in interface ComponentInterfacesetDefaultValues in class ComponentComponentInterface.setDefaultValues()public final double getDoubleData()
getDoubleData in interface com.sas.lang.DoubleDataInterfacepublic final void setDoubleData(double newValue)
setDoubleData in interface com.sas.lang.DoubleDataInterfacepublic double getMaximum()
public double getMinimum()
public double getBlockIncrement()
public double getUnitIncrement()
public double getValue()
public java.lang.Number incrementBy(int increment,
int incrementType)
incrementBy in interface IncrementInterfaceincrement - The number of incrementType(unit or block) amounts to increment
the current value(can be negative to decrement value).incrementType - UNIT to increment by the unit amount;
BLOCK to increment by the block amountpublic void setMaximum(double max)
max - the maximum value
java.lang.IllegalArgumentException - if max < minimumpublic void setMinimum(double min)
min - the minimum value
java.lang.IllegalArgumentException - if min > maximumpublic void setBlockIncrement(double block)
block - the block increment
java.lang.IllegalArgumentException - if (block < 0) or (block > (maximum - minimum))public void setUnitIncrement(double unit)
unit - the unit increment
java.lang.IllegalArgumentException - if (unit < 0) or (unit > (maximum - minimum))public void setValue(double newValue)
value - the current value
public void setValues(double value,
double min,
double max)
value - the new valuemin - the new minimummax - the new maximum
java.lang.IllegalArgumentException - if (min > max), (unit < 0),
(block < 0), (unit > range) or (block > range),
where range = (max - min)
public void setValues(double value,
double min,
double max,
double unit,
double block)
value - the new valuemin - the new minimummax - the new maximumunit - the new unit incrementblock - the new block increment
java.lang.IllegalArgumentException - if (min > max), (unit < 0),
(block < 0), (unit > range) or (block > range),
where range = (max - min)public final java.lang.Number getMaximumNumber()
getMaximumNumber in interface RangeInterfacepublic final java.lang.Number getMinimumNumber()
getMinimumNumber in interface RangeInterfacepublic final java.lang.Number getBlockIncrementNumber()
getBlockIncrementNumber in interface IncrementInterfacepublic final java.lang.Number getUnitIncrementNumber()
getUnitIncrementNumber in interface IncrementInterfacepublic final java.lang.Number getNumberValue()
getNumberValue in interface BoundedNumberInterfacepublic final void setMaximumNumber(java.lang.Number max)
setMaximumNumber in interface RangeInterfacemax - the maximum value
java.lang.IllegalArgumentException - if max < minimumpublic final void setMinimumNumber(java.lang.Number min)
setMinimumNumber in interface RangeInterfacemin - the minimum value
java.lang.IllegalArgumentException - if min > maximumpublic final void setBlockIncrementNumber(java.lang.Number block)
setBlockIncrementNumber in interface IncrementInterfaceblock - the block increment
java.lang.IllegalArgumentException - if (block < 0) or (block > (maximum - minimum))public final void setUnitIncrementNumber(java.lang.Number unit)
setUnitIncrementNumber in interface IncrementInterfaceunit - the unit increment
java.lang.IllegalArgumentException - if (unit < 0) or (unit > (maximum - minimum))public final void setNumberValue(java.lang.Number newValue)
setNumberValue in interface BoundedNumberInterfacevalue - the current value
public final void setNumberValues(java.lang.Number newValue,
java.lang.Number min,
java.lang.Number max)
setNumberValues in interface BoundedNumberInterfacevalue - the new valuemin - the new minimummax - the new maximum
java.lang.IllegalArgumentException - if (min > max), (unit < 0),
(block < 0), (unit > range) or (block > range),
where range = (max - min)
public final void setNumberValues(java.lang.Number newValue,
java.lang.Number min,
java.lang.Number max,
java.lang.Number unit,
java.lang.Number block)
setNumberValues in interface BoundedNumberInterfacevalue - the new valuemin - the new minimummax - the new maximumunit - the new unit incrementblock - the new block increment
java.lang.IllegalArgumentException - if (min > max), (unit < 0),
(block < 0), (unit > range) or (block > range),
where range = (max - min)
public boolean validateValue(java.lang.Object component,
java.lang.Object value)
ValidationInterface
validateValue in interface ValidationInterfacecomponent - an object containing the valuevalue - the value to be validated
public java.lang.Object normalizeValue(java.lang.Object component,
java.lang.Object value)
ValidationInterfaceThis might be used to change a valid date such as "5/5/96" into a normalized form such as "May 5, 1996".
normalizeValue in interface ValidationInterfacecomponent - an object containing the valuevalue - the value to be normalized
public java.lang.String getValidationMessageCode()
ValidationInterface
getValidationMessageCode in interface ValidationInterfacepublic void setValidationMessageCode(java.lang.String code)
public com.sas.text.Message getValidationMessage()
ValidationInterface
getValidationMessage in interface ValidationInterfacepublic void setValidationMessage(com.sas.text.Message message)
ValidationInterface
setValidationMessage in interface ValidationInterfacemessage - a Message object that contains a format string and substitution values,
which describe why the value passed to validateValue() is invalid.public void createValidationMessages()
public com.sas.text.Message newValidationMessage(java.lang.String template)
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||