Top Description Methods
com.amazon.ion

public Interface IonDecimal

extends IonNumber
Known Direct Implementers
com.amazon.ion.impl.lite.IonDecimalLite
Imports
java.math.BigDecimal

An Ion decimal value.

Warning

This interface should not be implemented or extended by code outside of this library.

Method Summary

Modifier and TypeMethod and Description
public BigDecimal

Returns:

the BigDecimal value, or null if this.isNullValue().
bigDecimalValue
()

Redeclares com.amazon.ion.IonNumber.bigDecimalValue.

Gets the value of this Ion decimal as a BigDecimal.

public IonDecimal
clone()

Redeclares com.amazon.ion.IonValue.clone.

Creates a copy of this value and all of its children.

public Decimal

Returns:

the Decimal value, or null if this.isNullValue().
decimalValue
()

Gets the value of this Ion decimal as a Decimal, which extends BigDecimal with support for negative zeros.

public double

Returns:

the double value.
doubleValue
()

Gets the value of this Ion decimal as a Java double value.

public float

Returns:

the float value.
floatValue
()

Gets the value of this Ion decimal as a Java float value.

public void
setValue(long value)

Sets the value of this element.

public void
setValue(float value)

Sets the value of this element.

public void
setValue(double value)

Sets the value of this element.

public void
setValue(BigDecimal
the new value of this decimal; may be null to make this null.decimal.
value
)

Sets the value of this element.

Inherited from com.amazon.ion.IonNumber:
isNumericValue

Method Detail

bigDecimalValueback to summary
public BigDecimal bigDecimalValue()

Redeclares com.amazon.ion.IonNumber.bigDecimalValue.

Gets the value of this Ion decimal as a BigDecimal. If you need negative zeros, use decimalValue().

Returns:BigDecimal

the BigDecimal value, or null if this.isNullValue().

See Also
decimalValue()
cloneback to summary
public IonDecimal clone() throws UnknownSymbolException

Redeclares com.amazon.ion.IonValue.clone.

Doc from com.amazon.ion.IonValue.clone.

Creates 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 instance isReadOnly().

The cloned value will be created in the context of the same ValueFactory as this instance; if you want a copy using a different factory, then use ValueFactory#clone(IonValue) instead.

Exceptions
UnknownSymbolException:
if any part of this value has unknown text but known Sid for its field name, annotation or symbol.
decimalValueback to summary
public Decimal decimalValue()

Gets the value of this Ion decimal as a Decimal, which extends BigDecimal with support for negative zeros.

Returns:Decimal

the Decimal value, or null if this.isNullValue().

See Also
bigDecimalValue()
doubleValueback to summary
public double doubleValue() throws NullValueException

Gets the value of this Ion decimal as a Java double value.

Returns:double

the double value.

Exceptions
NullValueException:
if this.isNullValue().
floatValueback to summary
public float floatValue() throws NullValueException

Gets the value of this Ion decimal as a Java float value.

Returns:float

the float value.

Exceptions
NullValueException:
if this.isNullValue().
setValueback to summary
public void setValue(long value)

Sets the value of this element.

setValueback to summary
public void setValue(float value)

Sets the value of this element. This method behaves like BigDecimal#valueOf(double) in that it uses the double's canonical string representation provided by Double#toString(double)}.

See Also
Decimal#valueOf(double)
setValueback to summary
public void setValue(double value)

Sets the value of this element. This method behaves like BigDecimal#valueOf(double) in that it uses the double's canonical string representation provided by Double#toString(double)}.

See Also
Decimal#valueOf(double)
setValueback to summary
public void setValue(BigDecimal value)

Sets the value of this element. To set a negative zero value, pass an Decimal.

Parameters
value:BigDecimal

the new value of this decimal; may be null to make this null.decimal.