|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Number
com.davisor.data.SimpleNumberValue
com.davisor.data.FloatData
FloatData represents float valued number data.
The data value inside may also be null. This indicates
that the number value of this object is undetermined.
FloatType,
Serialized Form| Field Summary |
| Fields inherited from class com.davisor.data.SimpleNumberValue |
M_type, M_value |
| Constructor Summary | |
FloatData()
Creates a new float number data object with the default type and value (0.0) |
|
FloatData(float value)
Create a new float number data object with the default type and given value. |
|
FloatData(FloatData data)
Shallow copy constructor. |
|
FloatData(FloatData data,
boolean deep)
Deep or shallow copy constructor. |
|
FloatData(FloatType type,
java.lang.String stringValue,
java.text.ParsePosition status)
Creates a float data value from a string value. |
|
FloatData(java.lang.Number value)
Creates a new float number data object with the default type and given value. |
|
FloatData(NumberType type)
Create a new float number data object with the given float type and default value (0.0). |
|
FloatData(NumberType type,
float value)
Create a new float number data object with the given type and value. |
|
FloatData(NumberType type,
java.lang.Number value)
Create a new float number data object with the given type and value. |
|
| Method Summary | |
DataValue |
abs()
Returns absolute data value of current value. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
java.lang.String |
getFormat()
Gets the type specification optimal for this particular value. |
DataValue |
negate()
Returns the negation of current value. |
void |
setValue(double value)
Sets the data float value. |
void |
setValue(float value)
Sets the data float value. |
void |
setValue(long value)
Sets the data long value. |
void |
setValue(java.lang.Number value)
Sets data Number value. |
void |
setValue(java.lang.String stringValue,
java.text.ParsePosition status)
Sets data value from a string value. |
void |
toStatement(java.sql.PreparedStatement statement,
int parameter)
Converts data to a prepared statement input parameter. |
| Methods inherited from class com.davisor.data.SimpleNumberValue |
add, byteValue, ceil, compareTo, deinterpolate, div, doubleValue, equals, floatValue, floor, getFormat, getType, hashCode, interpolate, intValue, isNull, longValue, max, min, mul, numberValue, setValue, setValue, setValue, shortValue, sub, toString, toXML, unit |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FloatData()
FloatData(NumberType,float)public FloatData(FloatData data)
data - source data (may be null)SimpleNumberValue.SimpleNumberValue(SimpleNumberValue,boolean)
public FloatData(FloatData data,
boolean deep)
data - source data (may be null)deep - determines if the copying is deep or shallowSimpleNumberValue.SimpleNumberValue(SimpleNumberValue,boolean)public FloatData(java.lang.Number value)
value - data value (may be null)SimpleNumberValue.SimpleNumberValue(NumberType,Number)public FloatData(float value)
value - data valueFloatData(NumberType,float)public FloatData(NumberType type)
type - the type of data (may be null)FloatData(NumberType,float)
public FloatData(NumberType type,
java.lang.Number value)
type - the type of data (may be null)value - data value (may be null)SimpleNumberValue.SimpleNumberValue(NumberType,Number)
public FloatData(NumberType type,
float value)
type - the type of data (may be null)value - data valueSimpleNumberValue.SimpleNumberValue(NumberType,Number)
public FloatData(FloatType type,
java.lang.String stringValue,
java.text.ParsePosition status)
throws InvalidDataException
type - the type of data (may be null)stringValue - string value to be parsed (may be null)status - parse status (may be null)
InvalidDataException - if string value could not be parsersetValue(String,ParsePosition)| Method Detail |
public DataValue abs()
throws InvalidDataException
Absolute values must satisfy a requirement that when added to any other value, the result must be greater than or equal to the original value.
abs in interface DataValueabs in class SimpleNumberValueInvalidDataException - if absolute value can not be computedpublic java.lang.String getFormat()
The float data optimal specificaton string describes a format that has a minimum number of decimals, but at least one.
getFormat in interface DataValuegetFormat in class SimpleNumberValueData.getType(),
FormatType.getFormat(),
FormatType.setFormat(java.util.Locale, java.lang.String)
public DataValue negate()
throws InvalidDataException
negate in interface DataValuenegate in class SimpleNumberValueInvalidDataException - if absolute value can not be computed
public void setValue(java.lang.String stringValue,
java.text.ParsePosition status)
throws InvalidDataException
stringValue - string value to be parsed (may be null)status - parse status (may be null)
InvalidDataException - if string value could not be parserSimpleNumberType.floatValue(String,ParsePosition)
public void toStatement(java.sql.PreparedStatement statement,
int parameter)
throws java.sql.SQLException
java.sql.SQLException - if a SQL error occurs.public com.davisor.core.Dupable dup()
public void setValue(float value)
throws InvalidDataException
setValue in interface NumberValuesetValue in class SimpleNumberValueInvalidDataException - never
public void setValue(double value)
throws InvalidDataException
setValue in interface NumberValuesetValue in class SimpleNumberValueInvalidDataException - if the value cannot
be converted to a float value
public void setValue(long value)
throws InvalidDataException
setValue in interface NumberValuesetValue in class SimpleNumberValueInvalidDataException - never
public void setValue(java.lang.Number value)
throws InvalidDataException
setValue in interface NumberValuesetValue in class SimpleNumberValueInvalidDataException - never
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||