public class BigIntegerValueImpl extends AbstractValue implements IntegerValue
NUMBER_TYPE_MASK, RAW_TYPE_MASK
Constructor and Description |
---|
BigIntegerValueImpl(java.math.BigInteger 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() |
IntegerValue |
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 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 MessageIntegerOverflowException
NumberValue
asByte
in interface NumberValue
MessageIntegerOverflowException
public short asShort() throws MessageIntegerOverflowException
NumberValue
asShort
in interface NumberValue
MessageIntegerOverflowException
public int asInt() throws MessageIntegerOverflowException
NumberValue
asInt
in interface NumberValue
MessageIntegerOverflowException
public long asLong() throws MessageIntegerOverflowException
NumberValue
asLong
in interface NumberValue
MessageIntegerOverflowException
public java.math.BigInteger asBigInteger() throws MessageIntegerOverflowException
NumberValue
asBigInteger
in interface NumberValue
MessageIntegerOverflowException
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 void writeTo(MessagePacker pk) throws java.io.IOException
public void accept(ValueVisitor visitor)
public IntegerValue toValue()
ValueRef
toValue
in interface IntegerValue
toValue
in interface ValueRef
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object