Package ca.uhn.fhir.model.primitive
Class DecimalDt
- All Implemented Interfaces:
IDatatype
,IElement
,IIdentifiableElement
,IPrimitiveDatatype<BigDecimal>
,ISupportsUndeclaredExtensions
,Externalizable
,Serializable
,Comparable<DecimalDt>
,IBase
,IBaseDatatype
,IBaseDecimalDatatype
,IPrimitiveType<BigDecimal>
public class DecimalDt
extends BasePrimitive<BigDecimal>
implements Comparable<DecimalDt>, IBaseDecimalDatatype
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
protected String
encode
(BigDecimal theValue) Subclasses must override to convert a "coerced" value into an encoded one.int
Gets the value as an integer, usingBigDecimal.intValue()
protected BigDecimal
Subclasses must override to convert an encoded representation of this datatype into a "coerced" onevoid
round
(int thePrecision) Rounds the value to the given previsionvoid
round
(int thePrecision, RoundingMode theRoundingMode) Rounds the value to the given previsionvoid
setValueAsInteger
(int theValue) Sets a new value using an integerMethods inherited from class ca.uhn.fhir.model.api.BasePrimitive
equals, getValue, getValueAsString, hashCode, hasValue, isEmpty, readExternal, setValue, setValueAsString, toString, updateStringValue, writeExternal
Methods inherited from class ca.uhn.fhir.model.api.BaseIdentifiableElement
getElementSpecificId, getId, setElementSpecificId, setId, setId
Methods inherited from class ca.uhn.fhir.model.api.BaseElement
addUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getFormatCommentsPost, getFormatCommentsPre, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, getUserData, hasFormatComment, isBaseEmpty, setUserData
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hl7.fhir.instance.model.api.IBase
fhirType, getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, isEmpty, setUserData
Methods inherited from interface org.hl7.fhir.instance.model.api.IPrimitiveType
hasValue
-
Constructor Details
-
DecimalDt
public DecimalDt()Constructor -
DecimalDt
Constructor -
DecimalDt
Constructor -
DecimalDt
Constructor -
DecimalDt
Constructor
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<DecimalDt>
-
encode
Description copied from class:BasePrimitive
Subclasses must override to convert a "coerced" value into an encoded one.- Specified by:
encode
in classBasePrimitive<BigDecimal>
- Parameters:
theValue
- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
getValueAsInteger
Gets the value as an integer, usingBigDecimal.intValue()
-
getValueAsNumber
-
parse
Description copied from class:BasePrimitive
Subclasses must override to convert an encoded representation of this datatype into a "coerced" one- Specified by:
parse
in classBasePrimitive<BigDecimal>
- Parameters:
theValue
- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
round
Rounds the value to the given prevision- See Also:
-
round
Rounds the value to the given prevision- See Also:
-
setValueAsInteger
Sets a new value using an integer
-