Package com.amazon.ion
Interface IonDecimal
-
-
Field Summary
-
Fields inherited from interface com.amazon.ion.IonValue
EMPTY_ARRAY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.math.BigDecimalbigDecimalValue()Gets the value of this Iondecimalas aBigDecimal.IonDecimalclone()Creates a copy of this value and all of its children.DecimaldecimalValue()Gets the value of this Iondecimalas aDecimal, which extendsBigDecimalwith support for negative zeros.doubledoubleValue()Gets the value of this Iondecimalas a Javadoublevalue.floatfloatValue()Gets the value of this Iondecimalas a Javafloatvalue.voidsetValue(double value)Sets the value of this element.voidsetValue(float value)Sets the value of this element.voidsetValue(long value)Sets the value of this element.voidsetValue(java.math.BigDecimal value)Sets the value of this element.-
Methods inherited from interface com.amazon.ion.IonNumber
isNumericValue
-
Methods inherited from interface com.amazon.ion.IonValue
accept, addTypeAnnotation, clearTypeAnnotations, equals, getContainer, getFieldId, getFieldName, getFieldNameSymbol, getSymbolTable, getSystem, getType, getTypeAnnotations, getTypeAnnotationSymbols, hashCode, hasTypeAnnotation, isNullValue, isReadOnly, makeReadOnly, removeFromContainer, removeTypeAnnotation, setTypeAnnotations, setTypeAnnotationSymbols, topLevelValue, toPrettyString, toString, toString, writeTo
-
-
-
-
Method Detail
-
floatValue
float floatValue() throws NullValueExceptionGets the value of this Iondecimalas a Javafloatvalue.- Returns:
- the float value.
- Throws:
NullValueException- ifthis.isNullValue().
-
doubleValue
double doubleValue() throws NullValueExceptionGets the value of this Iondecimalas a Javadoublevalue.- Returns:
- the double value.
- Throws:
NullValueException- ifthis.isNullValue().
-
bigDecimalValue
java.math.BigDecimal bigDecimalValue()
- Specified by:
bigDecimalValuein interfaceIonNumber- Returns:
- the
BigDecimalvalue, ornullifthis.isNullValue(). - See Also:
decimalValue()
-
decimalValue
Decimal decimalValue()
Gets the value of this Iondecimalas aDecimal, which extendsBigDecimalwith support for negative zeros.- Returns:
- the
Decimalvalue, ornullifthis.isNullValue(). - See Also:
bigDecimalValue()
-
setValue
void setValue(long value)
Sets the value of this element.
-
setValue
void setValue(float value)
Sets the value of this element. This method behaves likeBigDecimal.valueOf(double)in that it uses thedouble's canonical string representation provided byDouble.toString(double)}.- See Also:
Decimal.valueOf(double)
-
setValue
void setValue(double value)
Sets the value of this element. This method behaves likeBigDecimal.valueOf(double)in that it uses thedouble's canonical string representation provided byDouble.toString(double)}.- See Also:
Decimal.valueOf(double)
-
setValue
void setValue(java.math.BigDecimal value)
Sets the value of this element. To set a negative zero value, pass anDecimal.- Parameters:
value- the new value of this decimal; may benullto make thisnull.decimal.
-
clone
IonDecimal clone() throws UnknownSymbolException
Description copied from interface:IonValueCreates a copy of this value and all of its children. The cloned value may use the same shared symbol tables, but it will have an independent local symbol table if necessary. The cloned value will be modifiable regardless of whether this instanceIonValue.isReadOnly().The cloned value will be created in the context of the same
ValueFactoryas this instance; if you want a copy using a different factory, then useValueFactory.clone(IonValue)instead.- Specified by:
clonein interfaceIonValue- Throws:
UnknownSymbolException- if any part of this value has unknown text but known Sid for its field name, annotation or symbol.
-
-