|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.data.VoidData
com.davisor.data.VoidValue
com.davisor.data.GenericValue
com.davisor.data.BooleanData
BooleanData objects represent boolean data values.
BooleanType,
Serialized Form| Field Summary |
| Fields inherited from class com.davisor.data.VoidData |
M_type |
| Constructor Summary | |
BooleanData()
Creates a boolean data object with a default boolean type and value (false). |
|
BooleanData(boolean value)
Create a new boolean number data object with the default type and given value. |
|
BooleanData(java.lang.Boolean value)
Constructs a boolean data object with a default boolean type and given value. |
|
BooleanData(BooleanData data,
boolean deep)
Deep or shallow copy constructor. |
|
BooleanData(BooleanType type)
Constructs a boolean data object with a given boolean type and default value (false). |
|
BooleanData(BooleanType type,
boolean value)
Constructs a boolean data object with a given boolean type and value. |
|
BooleanData(BooleanType type,
java.lang.Boolean value)
Constructs a boolean data object with a given boolean type and value. |
|
BooleanData(BooleanType type,
java.lang.Number value)
Constructs a boolean data object with a given boolean type and value. |
|
BooleanData(BooleanType type,
java.lang.String stringValue,
java.text.ParsePosition status)
Creates a boolean data value from a string value. |
|
| Method Summary | |
DataValue |
abs()
Returns absolute data value of current value. |
DataValue |
add(DataValue value)
Multipies given value to the current value. |
static java.lang.Boolean |
and(java.lang.Boolean b1,
java.lang.Boolean b2)
Computes boolean AND value in a null -safe way. |
byte |
byteValue()
Gets number byte value. |
DataValue |
ceil(DataValue precision)
Quantizes the current value up to an even value within given precision. |
int |
compareTo(java.lang.Object o)
Compares this data with other data objects. |
double |
deinterpolate(DataValue min,
DataValue max)
De-interpolates the current data value to a scalar value, in respect, with the given data value range. |
DataValue |
div(DataValue value)
Divides the current value with given value. |
double |
doubleValue()
Gets number double value. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
boolean |
equals(java.lang.Object o)
Tests if this object is equal with another object. |
float |
floatValue()
Gets the number float value. |
DataValue |
floor(DataValue precision)
Quantizes the current value down to an even value within given precision. |
java.lang.String |
getFormat()
Gets the type specification optimal for this particular value. |
java.lang.Boolean |
getValue()
Gets the boolean data boolean value. |
boolean |
getValueDefault()
Gets the boolean data boolean value. |
int |
hashCode()
Returns a hash code value for the object. |
DataValue |
interpolate(double value,
DataValue max)
Interpolates the given scalar value to data value, in respect, with the range defined by this value and the given maximum value. |
int |
intValue()
Gets number int value. |
boolean |
isNull()
Tests if this data object value is undetermined. |
long |
longValue()
Gets number long value. |
DataValue |
max(DataValue value)
Finds the larger of this and the given data value. |
DataValue |
min(DataValue value)
Finds the smaller of this and the given data value. |
DataValue |
mul(DataValue value)
Multipies the current value with given value. |
DataValue |
negate()
Returns the negation of current value. |
static java.lang.Boolean |
not(java.lang.Boolean b)
Computes boolean NOT value in a null -safe way. |
java.lang.Number |
numberValue()
Gets the data Number value. |
static java.lang.Boolean |
or(java.lang.Boolean b1,
java.lang.Boolean b2)
Computes boolean OR value in a null -safe way. |
void |
setValue(boolean value)
Sets the boolean value. |
void |
setValue(java.lang.Boolean value)
Sets the boolean value. |
void |
setValue(byte value)
Sets the data byte value. |
void |
setValue(double value)
Sets the data double value. |
void |
setValue(float value)
Sets the data float value. |
void |
setValue(int value)
Sets the data int value. |
void |
setValue(long value)
Sets the data long value. |
void |
setValue(java.lang.Number value)
Sets the data Number value. |
void |
setValue(short value)
Sets the data short value. |
void |
setValue(java.lang.String stringValue,
java.text.ParsePosition status)
Sets data value from a string value. |
short |
shortValue()
Gets number short value. |
DataValue |
sub(DataValue value)
Substracts given value from the current value. |
void |
toStatement(java.sql.PreparedStatement statement,
int parameter)
Convert the data to a prepared statement input parameter. |
java.lang.String |
toString()
Gets the string representation of this boolean value. |
DataValue |
unit(DataValue targetValue,
double maxSteps)
Gets the largest suitable unit step to represent a value change between this value and the given target value. |
static java.lang.Boolean |
xor(java.lang.Boolean b1,
java.lang.Boolean b2)
Computes boolean XOR value in a null -safe way. |
| Methods inherited from class com.davisor.data.GenericValue |
toXML |
| Methods inherited from class com.davisor.data.VoidData |
getDataValue, getType, setType |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.davisor.data.DataValue |
toXML |
| Methods inherited from interface com.davisor.data.Data |
getType |
| Constructor Detail |
public BooleanData()
BooleanData(BooleanType,boolean)
public BooleanData(BooleanData data,
boolean deep)
data - source data (may be null)deep - determines if the copying is deep or shallowVoidData.getType(),
Type.dup()public BooleanData(BooleanType type)
type - custom boolean typeBooleanData(BooleanType,boolean)public BooleanData(java.lang.Boolean value)
value - boolean valueBooleanData(BooleanType,boolean)public BooleanData(boolean value)
value - data value
public BooleanData(BooleanType type,
boolean value)
type - custom boolean typevalue - boolean value
public BooleanData(BooleanType type,
java.lang.Boolean value)
type - custom boolean typevalue - boolean valueBooleanData(BooleanType,boolean)
public BooleanData(BooleanType type,
java.lang.Number value)
type - custom boolean typevalue - boolean value (a non-zero int value means true)
public BooleanData(BooleanType type,
java.lang.String stringValue,
java.text.ParsePosition status)
throws InvalidDataException
stringValue - string value to be parsedstatus - parse status (may be null)
InvalidDataException - if string value could not be parsersetValue(String,ParsePosition)| Method Detail |
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.ComparablecompareTo in class GenericValueCompare.compareTo(Boolean,Boolean)public boolean isNull()
isNull in interface SerializableDataisNull in class VoidValuetrue
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 VoidValueInvalidDataException - if absolute value can not be computed
public DataValue add(DataValue value)
throws InvalidDataException
or(java.lang.Boolean, java.lang.Boolean) operation.
add in interface DataValueadd in class VoidValuevalue - a data value to be added to this data value
InvalidDataException - if the data values cannot be added.
public DataValue ceil(DataValue precision)
throws InvalidDataException
Boolean values are quantized by default.
ceil in interface DataValueceil in class VoidValueprecision - the precision within quantization occurs (ignored)
InvalidDataException - if precision was of unacceptable typefloor(com.davisor.data.DataValue)
public double deinterpolate(DataValue min,
DataValue max)
throws InvalidDataException
Boolean values are de-interpolated with a table:
| own value
min value | max value | false | true
-----------|-----------|-------|------
false | false | 0.5 | 1.5
false | true | 0 | 1
true | true | -0.5 | 0.5
true | false | 1 | 0
deinterpolate in interface DataValuedeinterpolate in class VoidValuemin - a data value representing a range's lower limitmax - a data value representing a range's higher limit
InvalidDataException - if de-interpolation fails
public DataValue div(DataValue value)
throws InvalidDataException
xor(java.lang.Boolean, java.lang.Boolean) (exclusive or) operation.
div in interface DataValuediv in class VoidValuevalue - the divider
InvalidDataException - if divider is not BooleanData.
public DataValue floor(DataValue precision)
throws InvalidDataException
Boolean values are quantized by default.
floor in interface DataValuefloor in class VoidValueprecision - the precision within quantization occurs (ignored)
InvalidDataException - if precision was of unacceptable typeceil(com.davisor.data.DataValue)public java.lang.String getFormat()
The boolean data optimal specification string is always the current specification string for the current type.
getFormat in interface DataValuegetFormat in class VoidValueData.getType(),
FormatType.getFormat(),
FormatType.setFormat(java.util.Locale, java.lang.String)
public DataValue interpolate(double value,
DataValue max)
throws InvalidDataException
Boolean values are interpolated with the table:
scalar values
resulting in
|
own value | max value | false | true
-----------|-----------|--------|-------
false | false | <= 1 | > 1
false | true | < 0.5 | >= 0.5
true | true | < 0 | >= 0
true | false | >= 0.5 | < 0.5
interpolate in interface DataValueinterpolate in class VoidValuevalue - the scalar value to be interpolatedmax - a data value representing a range's higher limit
InvalidDataException - if interpolation fails
public DataValue max(DataValue value)
throws InvalidDataException
If the given value is null or an
instance of VoidValue, a reference to
this instance is returned.
max in interface DataValuemax in class GenericValuevalue - a data value to be compared with this data value
InvalidDataException - if the data value cannot be compared.GenericValue.compareTo(java.lang.Object)
public DataValue min(DataValue value)
throws InvalidDataException
If the given value is null or an
instance of VoidValue, a reference to
this instance is returned.
min in interface DataValuemin in class GenericValuevalue - a data value to be compared with this data value
InvalidDataException - if the data value cannot be compared.GenericValue.compareTo(java.lang.Object)
public DataValue mul(DataValue value)
throws InvalidDataException
and(java.lang.Boolean, java.lang.Boolean) operation.
mul in interface DataValuemul in class VoidValuevalue - the multiplier
InvalidDataException - if multiplier is not BooleanData.
public DataValue negate()
throws InvalidDataException
not(java.lang.Boolean) operation.
negate in interface DataValuenegate in class VoidValueInvalidDataException - if absolute value can not be computed
public void setValue(java.lang.String stringValue,
java.text.ParsePosition status)
throws InvalidDataException
setValue in interface DataValuesetValue in class VoidValuestringValue - string value to be parsed (may be null)status - parse status (may be null)
InvalidDataException - if string value could not be parsedBooleanType.decode(String,ParsePosition)
public DataValue sub(DataValue value)
throws InvalidDataException
xor(java.lang.Boolean, java.lang.Boolean) (exclusive or)
operation.
sub in interface DataValuesub in class VoidValuevalue - a data value to be substracted from this data value
InvalidDataException - if value cannot be
substracted.
public void toStatement(java.sql.PreparedStatement statement,
int parameter)
throws java.sql.SQLException
toStatement in interface DataValuetoStatement in class GenericValuestatement - statement to be updatedparameter - index of the statement parameter to be updated
java.sql.SQLException - if a SQL error occurs.VoidData.toString()
public DataValue unit(DataValue targetValue,
double maxSteps)
throws InvalidDataException
unit in interface DataValueunit in class VoidValuetargetValue - target value to be reached (may be null)maxSteps - maximum number of steps (zero leaves the choise open)
InvalidDataException - if target value is unsuitablepublic com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class VoidValuepublic byte byteValue()
byteValue in interface NumberValuejava.lang.NullPointerException - if number value is not setNumberType.byteValue(java.lang.String, java.text.ParsePosition)public double doubleValue()
doubleValue in interface NumberValuejava.lang.NullPointerException - if number value is not setNumberType.doubleValue(java.lang.String, java.text.ParsePosition)public float floatValue()
floatValue in interface NumberValuejava.lang.NullPointerException - if number value is not setNumberType.floatValue(java.lang.String, java.text.ParsePosition)public int intValue()
intValue in interface NumberValuejava.lang.NullPointerException - if number value is not setNumberType.intValue(java.lang.String, java.text.ParsePosition)public long longValue()
longValue in interface NumberValuejava.lang.NullPointerException - if number value is not setNumberType.longValue(java.lang.String, java.text.ParsePosition)public short shortValue()
shortValue in interface NumberValuejava.lang.NullPointerException - if number value is not setNumberType.shortValue(java.lang.String, java.text.ParsePosition)public java.lang.Number numberValue()
numberValue in interface NumberValue
public void setValue(byte value)
throws InvalidDataException
setValue in interface NumberValueInvalidDataException - if the value cannot
be converted to a byte value.
public void setValue(double value)
throws InvalidDataException
setValue in interface NumberValueInvalidDataException - if the value cannot
be converted to a double value.
public void setValue(float value)
throws InvalidDataException
setValue in interface NumberValueInvalidDataException - if the value cannot
be converted to a float value.
public void setValue(int value)
throws InvalidDataException
setValue in interface NumberValueInvalidDataException - if the value cannot
be converted to a int value.
public void setValue(java.lang.Number value)
throws InvalidDataException
setValue in interface NumberValueInvalidDataException - if the value cannot
be converted
public void setValue(long value)
throws InvalidDataException
setValue in interface NumberValueInvalidDataException - if the value cannot
be converted to a long value.
public void setValue(short value)
throws InvalidDataException
setValue in interface NumberValueInvalidDataException - if the value cannot
be converted to a short value.public boolean equals(java.lang.Object o)
Boolean data objects are equal if their super-classes and values are.
equals in class VoidDataCompare.equals(Object,Object),
Type.equals(Object)public int hashCode()
hashCode in class VoidDatapublic java.lang.String toString()
toString in interface DataValuetoString in class VoidDataBooleanType.encode(java.lang.Boolean)
public static java.lang.Boolean and(java.lang.Boolean b1,
java.lang.Boolean b2)
b1 - the first boolean value (may be null)b2 - the second boolean value (may be null)public java.lang.Boolean getValue()
public boolean getValueDefault()
false is returned by default.
public static java.lang.Boolean not(java.lang.Boolean b)
b - the boolean value (may be null)
public static java.lang.Boolean or(java.lang.Boolean b1,
java.lang.Boolean b2)
b1 - the first boolean value (may be null)b2 - the second boolean value (may be null)public void setValue(boolean value)
value - a boolean value
public void setValue(java.lang.Boolean value)
value - a boolean value (may be null)
public static java.lang.Boolean xor(java.lang.Boolean b1,
java.lang.Boolean b2)
b1 - the first boolean value (may be null)b2 - the second boolean value (may be null)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||