public class ImmutableDoubleValueImpl extends AbstractImmutableValue implements ImmutableFloatValue
ImmutableDoubleValueImpl Implements ImmutableFloatValue using a double field.FloatValue| Modifier and Type | Field and Description |
|---|---|
private double |
value |
| Constructor and Description |
|---|
ImmutableDoubleValueImpl(double value) |
| Modifier and Type | Method and Description |
|---|---|
ImmutableFloatValue |
asFloatValue()
Returns the value as
FloatValue. |
ImmutableNumberValue |
asNumberValue()
Returns the value as
NumberValue. |
boolean |
equals(java.lang.Object o)
Compares this value to the specified object.
|
ValueType |
getValueType()
Returns type of this value.
|
int |
hashCode() |
ImmutableDoubleValueImpl |
immutableValue()
Returns immutable copy of this value.
|
java.math.BigInteger |
toBigInteger()
Represent this value as a BigInteger, which may involve rounding or truncation of the original value.
|
byte |
toByte()
Represent this value as a byte value, which may involve rounding or truncation of the original value.
|
double |
toDouble()
Represent this value as a 64-bit double value, which may involve rounding or truncation of the original value.
|
float |
toFloat()
Represent this value as a 32-bit float value, which may involve rounding or truncation of the original value.
|
int |
toInt()
Represent this value as an int value, which may involve rounding or truncation of the original value.
|
java.lang.String |
toJson()
Returns json representation of this Value.
|
long |
toLong()
Represent this value as a long value, which may involve rounding or truncation of the original value.
|
short |
toShort()
Represent this value as a short value, which may involve rounding or truncation of the original value.
|
java.lang.String |
toString() |
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asStringValue, asTimestampValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitasArrayValue, asBinaryValue, asBooleanValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asStringValue, asTimestampValueasExtensionValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValuepublic ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic ImmutableDoubleValueImpl immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic ImmutableNumberValue asNumberValue()
ValueNumberValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((NumberValue) thisValue) to check type of a value because type of a mutable value is variable.asNumberValue in interface ValueasNumberValue in class AbstractImmutableValuepublic ImmutableFloatValue asFloatValue()
ValueFloatValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((FloatValue) thisValue) to check type of a value because type of a mutable value is variable.asFloatValue in interface ImmutableValueasFloatValue in interface ValueasFloatValue in class AbstractImmutableValuepublic byte toByte()
NumberValuetoByte in interface NumberValuepublic short toShort()
NumberValuetoShort in interface NumberValuepublic int toInt()
NumberValuetoInt in interface NumberValuepublic long toLong()
NumberValuetoLong in interface NumberValuepublic java.math.BigInteger toBigInteger()
NumberValuetoBigInteger in interface NumberValuepublic float toFloat()
NumberValuetoFloat in interface NumberValuepublic double toDouble()
NumberValuetoDouble in interface NumberValuepublic void writeTo(MessagePacker pk) throws java.io.IOException
ValueMessagePackerwriteTo in interface Valuejava.io.IOExceptionMessagePackerpublic boolean equals(java.lang.Object o)
Valuetrue if type and value are equivalent.
If this value is MapValue or ArrayValue, this method check equivalence of elements recursively.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toJson()
ValueFollowing behavior is not configurable at this release and they might be changed at future releases:
U+FFFD replacement character.U+FFFD replacement characterpublic java.lang.String toString()
toString in class java.lang.Object