private class Variable.IntegerValueAccessor extends Variable.AbstractNumberValueAccessor implements IntegerValue
| Modifier | Constructor and Description |
|---|---|
private |
IntegerValueAccessor() |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigInteger |
asBigInteger()
Returns the value as a
BigInteger. |
byte |
asByte()
Returns the value as a
byte, otherwise throws an exception. |
int |
asInt()
Returns the value as an
int, otherwise throws an exception. |
IntegerValue |
asIntegerValue()
Returns the value as
IntegerValue. |
long |
asLong()
Returns the value as a
long, otherwise throws an exception. |
short |
asShort()
Returns the value as a
short, otherwise throws an exception. |
ValueType |
getValueType()
Returns type of this value.
|
ImmutableIntegerValue |
immutableValue()
Returns immutable copy of this value.
|
boolean |
isInByteRange()
Returns true if the value is in the range of [-27 to 27-1].
|
boolean |
isInIntRange()
Returns true if the value is in the range of [-231 to 231-1]
|
boolean |
isInLongRange()
Returns true if the value is in the range of [-263 to 263-1]
|
boolean |
isInShortRange()
Returns true if the value is in the range of [-215 to 215-1]
|
MessageFormat |
mostSuccinctMessageFormat()
Returns the most succinct MessageFormat type to represent this integer value.
|
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
asNumberValue, toBigInteger, toByte, toDouble, toFloat, toInt, toLong, toShortasArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asMapValue, asNilValue, asRawValue, asStringValue, asTimestampValue, equals, hashCode, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValue, toJson, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waittoBigInteger, toByte, toDouble, toFloat, toInt, toLong, toShortasArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, asTimestampValue, equals, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValue, toJsonpublic ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic IntegerValue asIntegerValue()
ValueIntegerValue. 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 ValueasIntegerValue in class Variable.AbstractValueAccessorpublic ImmutableIntegerValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic boolean isInByteRange()
IntegerValueisInByteRange in interface IntegerValuepublic boolean isInShortRange()
IntegerValueisInShortRange in interface IntegerValuepublic boolean isInIntRange()
IntegerValueisInIntRange in interface IntegerValuepublic boolean isInLongRange()
IntegerValueisInLongRange in interface IntegerValuepublic MessageFormat mostSuccinctMessageFormat()
IntegerValuemostSuccinctMessageFormat in interface IntegerValuepublic byte asByte()
IntegerValuebyte, otherwise throws an exception.asByte in interface IntegerValuepublic short asShort()
IntegerValueshort, otherwise throws an exception.asShort in interface IntegerValuepublic int asInt()
IntegerValueint, otherwise throws an exception.asInt in interface IntegerValuepublic long asLong()
IntegerValuelong, otherwise throws an exception.asLong in interface IntegerValuepublic java.math.BigInteger asBigInteger()
IntegerValueBigInteger.asBigInteger in interface IntegerValuepublic void writeTo(MessagePacker pk) throws java.io.IOException
ValueMessagePackerwriteTo in interface Valuejava.io.IOExceptionMessagePacker