|
|||||||||||
| 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.CountData
CountData objects represent non-negative integer values that have a special string representation. In particular, this string representation repeats a given string token as many times as the counter value is. The counter string token is specified by the data specification string.
For example, if the counter token is '**', then the string '******' equals to counter value three.
The data value inside may also be null. This indicates
that the number value of this object is undetermined.
CountType,
Serialized Form| Field Summary |
| Fields inherited from class com.davisor.data.SimpleNumberValue |
M_type, M_value |
| Constructor Summary | |
CountData(CountData data,
boolean deep)
Deep or shallow copy constructor. |
|
CountData(CountType type)
Constructs a new counter data object with the given count type and unspecified value. |
|
CountData(CountType type,
short value)
Constructs a new counter data object with the given type and value. |
|
CountData(CountType type,
java.lang.String stringValue,
java.text.ParsePosition status)
Creates a count data value from a string value. |
|
CountData(NumberType type,
java.lang.Number value)
Constructs a new counter data object with 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 count double value. |
void |
setValue(long value)
Sets count long value. |
void |
setValue(java.lang.Number value)
Sets count Number value. |
void |
setValue(short value)
Sets count short 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)
Convert 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 CountData(CountData data,
boolean deep)
data - source data (may be null)deep - determines if the copying is deep or shallowSimpleNumberValue.SimpleNumberValue(SimpleNumberValue,boolean)public CountData(CountType type)
type - the type of data (may be null)SimpleNumberValue.SimpleNumberValue(NumberType)
public CountData(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 CountData(CountType type,
short value)
type - the type of data (may be null)value - data valueSimpleNumberValue.SimpleNumberValue(NumberType,Number)
public CountData(CountType 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 count data optimal specification string is always the current specification string for the current type.
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 parserCountType.countValue(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(double value)
throws InvalidDataException
setValue in interface NumberValuesetValue in class SimpleNumberValueInvalidDataException - if the value cannot
be converted to a count value
public void setValue(long value)
throws InvalidDataException
setValue in interface NumberValuesetValue in class SimpleNumberValueInvalidDataException - if the value cannot
be converted to a countvalue
public void setValue(short 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 | ||||||||||