public class DecimalType extends PrimitiveType<BigDecimal> implements Comparable<DecimalType>, org.hl7.fhir.instance.model.api.IBaseDecimalDatatype
| Constructor and Description |
|---|
DecimalType()
Constructor
|
DecimalType(BigDecimal theValue)
Constructor
|
DecimalType(double theValue)
Constructor
|
DecimalType(long theValue)
Constructor
|
DecimalType(String theValue)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DecimalType theObj) |
DecimalType |
copy() |
protected String |
encode(BigDecimal theValue)
Subclasses must override to convert a "coerced" value into an encoded one.
|
String |
fhirType() |
int |
getValueAsInteger()
Gets the value as an integer, using
BigDecimal.intValue() |
Number |
getValueAsNumber() |
protected BigDecimal |
parse(String theValue)
Subclasses must override to convert an encoded representation of this datatype into a "coerced" one
|
void |
round(int thePrecision)
Rounds the value to the given prevision
|
void |
round(int thePrecision,
RoundingMode theRoundingMode)
Rounds the value to the given prevision
|
DecimalType |
setRepresentation(String value)
A parser can provide a literal representation for the decimal value that preserves
the presented form.
|
void |
setValue(double theValue)
Sets a new value using a double
|
void |
setValue(long theValue)
Sets a new value using a long
|
void |
setValueAsInteger(int theValue)
Sets a new value using an integer
|
asStringValue, equalsDeep, equalsShallow, forceStringValue, fpValue, fromStringValue, getProperty, getTypesForProperty, getValue, getValueAsString, hashCode, hasPrimitiveValue, hasValue, isEmpty, isPrimitive, makeProperty, primitiveValue, readExternal, setProperty, setProperty, setValue, setValueAsString, toString, typedCopy, updateStringValue, writeExternaladdChild, addExtension, addExtension, addExtension, copyValues, getExtension, getExtensionByUrl, getExtensionFirstRep, getExtensionsByUrl, getExtensionString, getId, getIdBase, getIdElement, getNamedProperty, hasExtension, hasExtension, hasId, hasIdElement, isDisallowExtensions, listChildren, noExtensions, removeExtension, setDisallowExtensions, setExtension, setId, setIdBase, setIdElementcastToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCanonical, castToCode, castToCodeableConcept, castToCoding, castToContactDetail, castToContactPoint, castToContributor, castToDataRequirement, castToDate, castToDateTime, castToDecimal, castToDosage, castToDuration, castToElementDefinition, castToExpression, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMarketingStatus, castToMeta, castToMoney, castToNarrative, castToOid, castToParameterDefinition, castToPeriod, castToPopulation, castToPositiveInt, castToProdCharacteristic, castToProductShelfLife, castToQuantity, castToRange, castToRatio, castToReference, castToRelatedArtifact, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToSubstanceAmount, castToTime, castToTiming, castToTriggerDefinition, castToType, castToUnsignedInt, castToUri, castToUrl, castToUsageContext, castToXhtml, castToXhtmlString, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, dateTimeValue, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, hasFormatComment, hasType, hasUserData, isBooleanPrimitive, isDateTime, isMetadataBased, isResource, listChildrenByName, listChildrenByName, setUserData, setUserDataINNclone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitgetValue, getValueAsString, hasValue, setValue, setValueAsString, toValueOrNullgetFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, isEmpty, setUserDatapublic DecimalType()
public DecimalType(BigDecimal theValue)
public DecimalType(double theValue)
public DecimalType(long theValue)
public DecimalType(String theValue)
public int compareTo(DecimalType theObj)
compareTo in interface Comparable<DecimalType>protected String encode(BigDecimal theValue)
PrimitiveTypeencode in class PrimitiveType<BigDecimal>theValue - Will not be nullpublic int getValueAsInteger()
BigDecimal.intValue()public Number getValueAsNumber()
protected BigDecimal parse(String theValue)
PrimitiveTypeparse in class PrimitiveType<BigDecimal>theValue - Will not be nullpublic void round(int thePrecision)
MathContext.getPrecision()public void round(int thePrecision, RoundingMode theRoundingMode)
public void setValueAsInteger(int theValue)
public void setValue(long theValue)
public void setValue(double theValue)
public DecimalType copy()
copy in class PrimitiveType<BigDecimal>public DecimalType setRepresentation(String value)
value - Copyright © 2014–2021 Health Level 7. All rights reserved.