public interface IonNumber extends IonValue
int
, decimal
, and float
types.
WARNING: This interface should not be implemented or extended by code outside of this library.
EMPTY_ARRAY
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
bigDecimalValue()
Gets the value of this Ion number as a
BigDecimal . |
boolean |
isNumericValue()
Determines whether this value is numeric.
|
accept, addTypeAnnotation, clearTypeAnnotations, clone, equals, getContainer, getFieldId, getFieldName, getFieldNameSymbol, getSymbolTable, getSystem, getType, getTypeAnnotations, getTypeAnnotationSymbols, hashCode, hasTypeAnnotation, isNullValue, isReadOnly, makeReadOnly, removeFromContainer, removeTypeAnnotation, setTypeAnnotations, setTypeAnnotationSymbols, topLevelValue, toPrettyString, toString, toString, writeTo
java.math.BigDecimal bigDecimalValue()
BigDecimal
.
This method will throw an exception for non-null, non-numeric values.
It's recommended to call isNumericValue()
before calling
this method.
Negative zero is supported by IonDecimal
and IonFloat
,
but not by BigDecimal
. If you need to distinguish positive and
negative zero, you should call IonDecimal.decimalValue()
or
IonFloat.doubleValue()
after casting to the appropriate type.
BigDecimal
value, or null
if
this.isNullValue()
.java.lang.NumberFormatException
- if this value is nan
,
+inf
, or -inf
, because BigDecimal
cannot
represent those values.boolean isNumericValue()
null
, nan
, +inf
, and -inf
,
and false if it is any of them.