public class ImmutableDoubleValueImpl extends java.lang.Object implements ImmutableFloatValue
ImmutableDoubleValueImpl
Implements ImmutableFloatValue
using a double
field.FloatValue
Constructor and Description |
---|
ImmutableDoubleValueImpl(double value) |
Modifier and Type | Method and Description |
---|---|
ImmutableArrayValue |
asArrayValue()
Returns the value as
ArrayValue . |
ImmutableBinaryValue |
asBinaryValue()
Returns the value as
BinaryValue . |
ImmutableBooleanValue |
asBooleanValue()
Returns the value as
BooleanValue . |
ImmutableExtensionValue |
asExtensionValue()
Returns the value as
ExtensionValue . |
ImmutableFloatValue |
asFloatValue()
Returns the value as
FloatValue . |
ImmutableIntegerValue |
asIntegerValue()
Returns the value as
IntegerValue . |
ImmutableMapValue |
asMapValue()
Returns the value as
MapValue . |
ImmutableNilValue |
asNilValue()
Returns the value as
NilValue . |
ImmutableNumberValue |
asNumberValue()
Returns the value as
NumberValue . |
ImmutableRawValue |
asRawValue()
Returns the value as
RawValue . |
ImmutableStringValue |
asStringValue()
Returns the value as
StringValue . |
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.
|
boolean |
isArrayValue()
Returns true if type of this value is Array.
|
boolean |
isBinaryValue()
Returns true if type of this value is Binary.
|
boolean |
isBooleanValue()
Returns true if type of this value is Boolean.
|
boolean |
isExtensionValue()
Returns true if type of this an Extension.
|
boolean |
isFloatValue()
Returns true if type of this value is Float.
|
boolean |
isIntegerValue()
Returns true if type of this value is Integer.
|
boolean |
isMapValue()
Returns true if type of this value is Map.
|
boolean |
isNilValue()
Returns true if type of this value is Nil.
|
boolean |
isNumberValue()
Returns true if type of this value is Integer or Float.
|
boolean |
isRawValue()
Returns true if type of this value is String or Binary.
|
boolean |
isStringValue()
Returns true if type of this value is String.
|
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 |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asArrayValue, asBinaryValue, asBooleanValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asStringValue
asExtensionValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue
public ValueType getValueType()
Value
instanceof
to check type of a value because type of a mutable value is variable.getValueType
in interface Value
public ImmutableDoubleValueImpl immutableValue()
Value
this
without copying the value if this value is already immutable.immutableValue
in interface Value
public ImmutableNumberValue asNumberValue()
Value
NumberValue
. 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 Value
public ImmutableFloatValue asFloatValue()
Value
FloatValue
. 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 ImmutableValue
asFloatValue
in interface Value
public byte toByte()
NumberValue
toByte
in interface NumberValue
public short toShort()
NumberValue
toShort
in interface NumberValue
public int toInt()
NumberValue
toInt
in interface NumberValue
public long toLong()
NumberValue
toLong
in interface NumberValue
public java.math.BigInteger toBigInteger()
NumberValue
toBigInteger
in interface NumberValue
public float toFloat()
NumberValue
toFloat
in interface NumberValue
public double toDouble()
NumberValue
toDouble
in interface NumberValue
public void writeTo(MessagePacker pk) throws java.io.IOException
Value
MessagePacker
writeTo
in interface Value
java.io.IOException
MessagePacker
public boolean equals(java.lang.Object o)
Value
true
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.Object
public java.lang.String toJson()
Value
Following behavior is not configurable at this release and they might be changed at future releases:
U+FFFD replacement character
.U+FFFD replacement character
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isNilValue()
Value
asNilValue
never throws exceptions.
Note that you can't use instanceof
or cast ((NilValue) thisValue)
to check type of a value because type of a mutable value is variable.isNilValue
in interface Value
public boolean isBooleanValue()
Value
asBooleanValue
never throws exceptions.
Note that you can't use instanceof
or cast ((BooleanValue) thisValue)
to check type of a value because type of a mutable value is variable.isBooleanValue
in interface Value
public boolean isNumberValue()
Value
asNumberValue
never throws exceptions.
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.isNumberValue
in interface Value
public boolean isIntegerValue()
Value
asIntegerValue
never throws exceptions.
Note that you can't use instanceof
or cast ((IntegerValue) thisValue)
to check type of a value because type of a mutable value is variable.isIntegerValue
in interface Value
public boolean isFloatValue()
Value
asFloatValue
never throws exceptions.
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.isFloatValue
in interface Value
public boolean isRawValue()
Value
asRawValue
never throws exceptions.
Note that you can't use instanceof
or cast ((RawValue) thisValue)
to check type of a value because type of a mutable value is variable.isRawValue
in interface Value
public boolean isBinaryValue()
Value
asBinaryValue
never throws exceptions.
Note that you can't use instanceof
or cast ((BinaryValue) thisValue)
to check type of a value because type of a mutable value is variable.isBinaryValue
in interface Value
public boolean isStringValue()
Value
asStringValue
never throws exceptions.
Note that you can't use instanceof
or cast ((StringValue) thisValue)
to check type of a value because type of a mutable value is variable.isStringValue
in interface Value
public boolean isArrayValue()
Value
asArrayValue
never throws exceptions.
Note that you can't use instanceof
or cast ((ArrayValue) thisValue)
to check type of a value because type of a mutable value is variable.isArrayValue
in interface Value
public boolean isMapValue()
Value
asMapValue
never throws exceptions.
Note that you can't use instanceof
or cast ((MapValue) thisValue)
to check type of a value because type of a mutable value is variable.isMapValue
in interface Value
public boolean isExtensionValue()
Value
asExtensionValue
never throws exceptions.
Note that you can't use instanceof
or cast ((ExtensionValue) thisValue)
to check type of a value because
type of a mutable value is variable.isExtensionValue
in interface Value
public ImmutableNilValue asNilValue()
Value
NilValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((NilValue) thisValue)
to check type of a value because type of a mutable value is variable.asNilValue
in interface ImmutableValue
asNilValue
in interface Value
public ImmutableBooleanValue asBooleanValue()
Value
BooleanValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((BooleanValue) thisValue)
to check type of a value because type of a mutable value is variable.asBooleanValue
in interface ImmutableValue
asBooleanValue
in interface Value
public ImmutableIntegerValue asIntegerValue()
Value
IntegerValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((IntegerValue) thisValue)
to check type of a value because type of a mutable value is variable.asIntegerValue
in interface ImmutableValue
asIntegerValue
in interface Value
public ImmutableRawValue asRawValue()
Value
RawValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((RawValue) thisValue)
to check type of a value because type of a mutable value is variable.asRawValue
in interface ImmutableValue
asRawValue
in interface Value
public ImmutableBinaryValue asBinaryValue()
Value
BinaryValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((BinaryValue) thisValue)
to check type of a value because type of a mutable value is variable.asBinaryValue
in interface ImmutableValue
asBinaryValue
in interface Value
public ImmutableStringValue asStringValue()
Value
StringValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((StringValue) thisValue)
to check type of a value because type of a mutable value is variable.asStringValue
in interface ImmutableValue
asStringValue
in interface Value
public ImmutableArrayValue asArrayValue()
Value
ArrayValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((ArrayValue) thisValue)
to check type of a value because type of a mutable value is variable.asArrayValue
in interface ImmutableValue
asArrayValue
in interface Value
public ImmutableMapValue asMapValue()
Value
MapValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((MapValue) thisValue)
to check type of a value because type of a mutable value is variable.asMapValue
in interface ImmutableValue
asMapValue
in interface Value
public ImmutableExtensionValue asExtensionValue()
Value
ExtensionValue
. Otherwise throws MessageTypeCastException
.
Note that you can't use instanceof
or cast ((ExtensionValue) thisValue)
to check type of a value
because type of a mutable value is variable.asExtensionValue
in interface Value