Package com.amazon.ion
Interface IonDecimal
An Ion
decimal value.
WARNING: This interface should not be implemented or extended by code outside of this library.
-
Field Summary
Fields inherited from interface com.amazon.ion.IonValue
EMPTY_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionGets the value of this Iondecimalas aBigDecimal.clone()Creates a copy of this value and all of its children.Gets the value of this Iondecimalas aDecimal, which extendsBigDecimalwith support for negative zeros.doubleGets the value of this Iondecimalas a Javadoublevalue.floatGets 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(BigDecimal value) Sets the value of this element.Methods inherited from interface com.amazon.ion.IonNumber
isNumericValueMethods 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 Details
-
floatValue
Gets the value of this Iondecimalas a Javafloatvalue.- Returns:
- the float value.
- Throws:
NullValueException- ifthis.isNullValue().
-
doubleValue
Gets the value of this Iondecimalas a Javadoublevalue.- Returns:
- the double value.
- Throws:
NullValueException- ifthis.isNullValue().
-
bigDecimalValue
BigDecimal bigDecimalValue()- Specified by:
bigDecimalValuein interfaceIonNumber- Returns:
- the
BigDecimalvalue, ornullifthis.isNullValue(). - See Also:
-
decimalValue
Decimal decimalValue()Gets the value of this Iondecimalas aDecimal, which extendsBigDecimalwith support for negative zeros.- Returns:
- the
Decimalvalue, ornullifthis.isNullValue(). - See Also:
-
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:
-
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:
-
setValue
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
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.
-