Top Fields Constructors Methods
com.amazon.ion.impl.lite

pack-priv final Class IonDecimalLite

extends IonValueLite
implements IonDecimal
Class Inheritance
All Implemented Interfaces
com.amazon.ion.IonDecimal, com.amazon.ion.IonNumber, com.amazon.ion.IonValue, java.lang.Cloneable
Imports
com.amazon.ion.Decimal, .IonDecimal, .IonType, .IonWriter, .NullValueException, .ValueVisitor, java.io.IOException, java.math.BigDecimal

Field Summary

Modifier and TypeField and Description
private BigDecimal
private static final int
private static final int
Inherited from com.amazon.ion.impl.lite.IonValueLite:
_annotations_context_fieldNameCONTAINER_STACK_INITIAL_CAPACITYELEMENT_SHIFTIS_AUTO_CREATEDIS_BOOL_TRUEIS_IVMIS_LOCKEDIS_NULL_VALUEIS_SYMBOL_ID_PRESENTIS_SYMBOL_PRESENTIS_SYSTEM_VALUE

Constructor Summary

AccessConstructor and Description
pack-priv
IonDecimalLite(ContainerlessContext context, boolean isNull)

Constructs a null.decimal element.

pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
accept(ValueVisitor
will have one of its visit methods called.
visitor
)

Implements abstract com.amazon.ion.impl.lite.IonValueLite.accept.

Implements com.amazon.ion.IonValue.accept.

Entry point for visitor pattern.

public BigDecimal
bigDecimalValue()

Implements com.amazon.ion.IonDecimal.bigDecimalValue.

Gets the value of this Ion decimal as a BigDecimal.

public IonDecimalLite
clone()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.clone.

Implements com.amazon.ion.IonDecimal.clone, com.amazon.ion.IonValue.clone.

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

public Decimal
decimalValue()

Implements com.amazon.ion.IonDecimal.decimalValue.

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

public double
doubleValue()

Implements com.amazon.ion.IonDecimal.doubleValue.

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

public float
floatValue()

Implements com.amazon.ion.IonDecimal.floatValue.

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

public IonType
pack-priv int
public static boolean
isNegativeZero(float value)

public static boolean
isNegativeZero(double value)

public boolean
isNumericValue()

Implements com.amazon.ion.IonNumber.isNumericValue.

Determines whether this value is numeric.

pack-priv int
scalarHashCode()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.scalarHashCode.

Internal HashCode implementation to be overridden by scalar subclasses.

public void
setValue(long value)

Implements com.amazon.ion.IonDecimal.setValue.

Sets the value of this element.

public void
setValue(float value)

Implements com.amazon.ion.IonDecimal.setValue.

Sets the value of this element.

public void
setValue(double value)

Implements com.amazon.ion.IonDecimal.setValue.

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
)

Implements com.amazon.ion.IonDecimal.setValue.

Sets the value of this element.

pack-priv IonValueLite
shallowClone(IonContext
the context applicable to the value's parent.
parentContext
)

Implements abstract com.amazon.ion.impl.lite.IonValueLite.shallowClone.

Clones the value's annotations and field name (if any).

pack-priv final void
writeBodyTo(IonWriter
an IonWriter.
writer
,
_Private_IonValue.SymbolTableProvider
a SymbolTableProvider.
symbolTableProvider
)

Implements abstract com.amazon.ion.impl.lite.IonValueLite.writeBodyTo.

Writes a *non-null scalar* value to the given writer.

Inherited from com.amazon.ion.impl.lite.IonValueLite:
_elementid_elementid_getMetadata_isAutoCreated_isAutoCreated_isBoolTrue_isBoolTrue_isIVM_isIVM_isLocked_isLocked_isNullValue_isNullValue_isSymbolIdPresent_isSymbolIdPresent_isSymbolPresent_isSymbolPresent_isSystemValue_isSystemValue_setMetadataaddTypeAnnotationattemptClearSymbolIDValuescascadeSIDPresentToContextRootcheckAnnotationsForSidscheckForLockclearSymbolIDValuesclearTypeAnnotationscopyFieldNamedetachFromContainerdumpequalsfindTypeAnnotationgetAssignedSymbolTablegetContainergetContextgetElementIdgetFieldIdgetFieldNamegetFieldNameIdgetFieldNameSymbolgetFieldNameSymbolgetKnownFieldNameSymbolgetSymbolTablegetSystemgetTypegetTypeAnnotationsgetTypeAnnotationSymbolsgetTypeAnnotationSymbolshashCodehashTypeAnnotationshasTypeAnnotationisNullValueisReadOnlymakeReadOnlymakeReadOnlyInternalremoveFromContainerremoveTypeAnnotationsetContextsetFieldNamesetFieldNameSymbolsetSymbolTablesetTypeAnnotationssetTypeAnnotationSymbolstopLevelValuetoPrettyStringtoStringtoStringvalidatevalidateThisNotNullwriteTowriteTo

Field Detail

_decimal_valueback to summary
private BigDecimal _decimal_value
HASH_SIGNATUREback to summary
private static final int HASH_SIGNATURE
NEGATIVE_ZERO_HASH_SIGNATUREback to summary
private static final int NEGATIVE_ZERO_HASH_SIGNATURE

Constructor Detail

IonDecimalLiteback to summary
pack-priv IonDecimalLite(ContainerlessContext context, boolean isNull)

Constructs a null.decimal element.

IonDecimalLiteback to summary
pack-priv IonDecimalLite(IonDecimalLite existing, IonContext context)

Method Detail

acceptback to summary
public void accept(ValueVisitor visitor) throws Exception

Implements abstract com.amazon.ion.impl.lite.IonValueLite.accept.

Implements com.amazon.ion.IonValue.accept.

Doc from com.amazon.ion.IonValue.accept.

Entry point for visitor pattern. Implementations of this method by concrete classes will simply call the appropriate visit method on the visitor. For example, instances of IonBool will invoke ValueVisitor#visit(IonBool).

Parameters
visitor:ValueVisitor

will have one of its visit methods called.

Annotations
@Override
Exceptions
Exception:
any exception thrown by the visitor is propagated.
bigDecimalValueback to summary
public BigDecimal bigDecimalValue() throws NullValueException

Implements com.amazon.ion.IonDecimal.bigDecimalValue.

Doc from com.amazon.ion.IonDecimal.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().

Annotations
@Override
cloneback to summary
public IonDecimalLite clone()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.clone.

Implements com.amazon.ion.IonDecimal.clone, 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.

Returns:IonDecimalLite

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
decimalValueback to summary
public Decimal decimalValue() throws NullValueException

Implements com.amazon.ion.IonDecimal.decimalValue.

Doc from com.amazon.ion.IonDecimal.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().

doubleValueback to summary
public double doubleValue() throws NullValueException

Implements com.amazon.ion.IonDecimal.doubleValue.

Doc from com.amazon.ion.IonDecimal.doubleValue.

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

Implements com.amazon.ion.IonDecimal.floatValue.

Doc from com.amazon.ion.IonDecimal.floatValue.

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

Returns:float

the float value.

Exceptions
NullValueException:
if this.isNullValue().
getTypeSlowback to summary
public IonType getTypeSlow()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.getTypeSlow.

Returns:IonType

Doc from com.amazon.ion.impl.lite.IonValueLite.getTypeSlow.

the value's type.

Annotations
@Override
hashSignatureback to summary
pack-priv int hashSignature()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.hashSignature.

Returns:int

Doc from com.amazon.ion.impl.lite.IonValueLite.hashSignature.

the constant hash signature unique to the value's type.

Annotations
@Override
isNegativeZeroback to summary
public static boolean isNegativeZero(float value)
isNegativeZeroback to summary
public static boolean isNegativeZero(double value)
isNumericValueback to summary
public boolean isNumericValue()

Implements com.amazon.ion.IonNumber.isNumericValue.

Doc from com.amazon.ion.IonNumber.isNumericValue.

Determines whether this value is numeric. Returns true if this value is none of null, nan, +inf, and -inf, and false if it is any of them.

Returns:boolean

a checked condition whether this value is numeric.

Annotations
@Override
scalarHashCodeback to summary
pack-priv int scalarHashCode()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.scalarHashCode.

Doc from com.amazon.ion.impl.lite.IonValueLite.scalarHashCode.

Internal HashCode implementation to be overridden by scalar subclasses. Must only be called on non-null values.

Annotations
@Override
setValueback to summary
public void setValue(long value)

Implements com.amazon.ion.IonDecimal.setValue.

Doc from com.amazon.ion.IonDecimal.setValue.

Sets the value of this element.

setValueback to summary
public void setValue(float value)

Implements com.amazon.ion.IonDecimal.setValue.

Doc from com.amazon.ion.IonDecimal.setValue.

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)}.

setValueback to summary
public void setValue(double value)

Implements com.amazon.ion.IonDecimal.setValue.

Doc from com.amazon.ion.IonDecimal.setValue.

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)}.

setValueback to summary
public void setValue(BigDecimal value)

Implements com.amazon.ion.IonDecimal.setValue.

Doc from com.amazon.ion.IonDecimal.setValue.

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.

shallowCloneback to summary
pack-priv IonValueLite shallowClone(IonContext parentContext)

Implements abstract com.amazon.ion.impl.lite.IonValueLite.shallowClone.

Doc from com.amazon.ion.impl.lite.IonValueLite.shallowClone.

Clones the value's annotations and field name (if any). For scalars, also clones the value. For containers, leaves the cloned container empty rather than cloning the children.

Parameters
parentContext:IonContext

the context applicable to the value's parent.

Returns:IonValueLite

a shallow clone of this value.

Annotations
@Override
writeBodyToback to summary
pack-priv final void writeBodyTo(IonWriter writer, _Private_IonValue.SymbolTableProvider symbolTableProvider) throws IOException

Implements abstract com.amazon.ion.impl.lite.IonValueLite.writeBodyTo.

Doc from com.amazon.ion.impl.lite.IonValueLite.writeBodyTo.

Writes a *non-null scalar* value to the given writer. It is incorrect to call this method on a container value.

Parameters
writer:IonWriter

an IonWriter.

symbolTableProvider:_Private_IonValue.SymbolTableProvider

a SymbolTableProvider.

Annotations
@Override
Exceptions
IOException:
if thrown when writing the value.