public class FloatValueImpl extends AbstractValue implements FloatValue
NUMBER_TYPE_MASK, RAW_TYPE_MASK
Constructor and Description |
---|
FloatValueImpl(float value) |
Modifier and Type | Method and Description |
---|---|
void |
accept(ValueVisitor visitor) |
java.math.BigInteger |
asBigInteger()
Convert this value into a BigInteger value.
|
byte |
asByte()
Convert this value into a byte value.
|
int |
asInt()
Convert this value into an int value.
|
long |
asLong()
Convert this value into a long value.
|
short |
asShort()
Convert this value into a short value.
|
boolean |
equals(java.lang.Object o) |
ValueType |
getValueType() |
int |
hashCode() |
boolean |
isValidByte()
Check whether this value is a valid byte value.
|
boolean |
isValidInt()
Check whether this value is a valid integer value.
|
boolean |
isValidLong()
Check whether this value is a valid long value.
|
boolean |
isValidShort()
Check whether this value is a valid short value.
|
boolean |
isWhole()
Returns true if this number has no decimal component
|
java.math.BigInteger |
toBigInteger()
Convert this value into a BigInteger
|
byte |
toByte()
Convert this value into a byte value.
|
double |
toDouble()
Convert this value into a double value
|
float |
toFloat()
Convert this value into a float value
|
int |
toInt()
Convert this value into an int value.
|
long |
toLong()
Convert this value into a long value.
|
short |
toShort()
Convert this value into a short value.
|
java.lang.String |
toString() |
FloatValue |
toValue()
Create an immutable value from this reference
|
void |
writeTo(MessagePacker pk) |
isRef
as, as, asArrayValue, asBinary, asBoolean, asExtended, asFloat, asInteger, asMapValue, asNil, asNumber, asRaw, asString, getArrayCursor, getMapCursor, isArray, isBinary, isBoolean, isExtended, isFloat, isInteger, isMap, isNil, isNumber, isRaw, isString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asArrayValue, asMapValue
public ValueType getValueType()
getValueType
in interface ValueRef
public boolean isValidByte()
NumberValue
isValidByte
in interface NumberValue
Byte.MIN_VALUE
and Byte.MAX_VALUE
; otherwise returns falsepublic boolean isValidShort()
NumberValue
isValidShort
in interface NumberValue
Short.MIN_VALUE
and Short.MAX_VALUE
; otherwise returns falsepublic boolean isValidInt()
NumberValue
isValidInt
in interface NumberValue
Integer.MIN_VALUE
and Integer.MAX_VALUE
; otherwise returns falsepublic boolean isValidLong()
NumberValue
isValidLong
in interface NumberValue
Long.MIN_VALUE
and Long.MAX_VALUE
; otherwise returns falsepublic boolean isWhole()
NumberValue
isWhole
in interface NumberValue
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 byte asByte() throws MessageOverflowException
NumberValue
asByte
in interface NumberValue
MessageOverflowException
- when the value is not within the range of Byte.MIN_VALUE
and Byte.MAX_VALUE
;public short asShort() throws MessageOverflowException
NumberValue
asShort
in interface NumberValue
MessageOverflowException
- when the value is not within the range of Short.MIN_VALUE
and Short.MAX_VALUE
public int asInt() throws MessageOverflowException
NumberValue
asInt
in interface NumberValue
MessageOverflowException
- when the value is not within the range of Integer.MIN_VALUE
and Integer.MAX_VALUE
public long asLong() throws MessageOverflowException
NumberValue
asLong
in interface NumberValue
MessageOverflowException
- when the value is not within the range of Long.MIN_VALUE
and Long.MAX_VALUE
public java.math.BigInteger asBigInteger() throws MessageOverflowException
NumberValue
asBigInteger
in interface NumberValue
MessageOverflowException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void writeTo(MessagePacker pk) throws java.io.IOException
public void accept(ValueVisitor visitor)
public FloatValue toValue()
ValueRef
toValue
in interface FloatValue
toValue
in interface ValueRef
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object