/** * Sets the value for <b>factor</b> () * * <p> * <b>Definition:</b> * A correction factor that is applied to the sampled data points before they are added to the origin * </p> */ public SampledDataDt setFactor( java.math.BigDecimal theValue) { myFactor = new DecimalDt(theValue); return this; }
@Override public int compareTo(DecimalDt theObj) { if (getValue() == null && theObj.getValue() == null) { return 0; } if (getValue() != null && (theObj == null || theObj.getValue() == null)) { return 1; } if (getValue() == null && theObj.getValue() != null) { return -1; } return getValue().compareTo(theObj.getValue()); }
/** * Rounds the value to the given prevision * * @see MathContext#getPrecision() * @see MathContext#getRoundingMode() */ public void round(int thePrecision, RoundingMode theRoundingMode) { if (getValue() != null) { BigDecimal newValue = getValue().round(new MathContext(thePrecision, theRoundingMode)); setValue(newValue); } }
if (nextValue.getValueElement().isEmpty()) { continue; ResourceIndexedSearchParamQuantity nextEntity = new ResourceIndexedSearchParamQuantity(resourceName, nextValue.getValueElement().getValue(), nextValue.getSystemElement().getValueAsString(), nextValue.getCode()); nextEntity.setResource(theEntity); retVal.add(nextEntity);
private static DecimalDt getDecimalFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum<?>, Object> theResourceMetadata, ResourceMetadataKeyEnum<DecimalDt> theKey) { Object retValObj = theResourceMetadata.get(theKey); if (retValObj == null) { return null; } else if (retValObj instanceof DecimalDt) { if (((DecimalDt) retValObj).isEmpty()) { return null; } return (DecimalDt) retValObj; } else if (retValObj instanceof String) { if (StringUtils.isBlank((String) retValObj)) { return null; } return new DecimalDt((String) retValObj); } else if (retValObj instanceof Double) { return new DecimalDt((Double) retValObj); } throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + InstantDt.class.getCanonicalName()); }
@Override public String getValueAsQueryToken(FhirContext theContext) { StringBuilder b= new StringBuilder(); if (getComparatorElement() != null) { b.append(getComparatorElement().getValue()); } if (!getValueElement().isEmpty()) { b.append(getValueElement().getValueAsString()); } b.append('|'); if (!getSystemElement().isEmpty()) { b.append(getSystemElement().getValueAsString()); } b.append('|'); if (!getUnitsElement().isEmpty()) { b.append(getUnitsElement().getValueAsString()); } return b.toString(); }
/** * Constructor */ public DecimalDt(String theValue) { setValue(new BigDecimal(theValue)); }
if (nextValue.getValueElement().isEmpty()) { continue; } else if (nextObject instanceof QuantityDt) { QuantityDt nextValue = (QuantityDt) nextObject; if (nextValue.getValueElement().isEmpty()) { continue; } else if (nextObject instanceof DecimalDt) { DecimalDt nextValue = (DecimalDt) nextObject; if (nextValue.getValue() == null) { continue; ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity);
/** * Sets a new value using an integer */ public void setValueAsInteger(int theValue) { setValue(new BigDecimal(theValue)); }
/** * Sets the value for <b>upperLimit</b> () * * <p> * <b>Definition:</b> * The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit) * </p> */ public SampledDataDt setUpperLimit( long theValue) { myUpperLimit = new DecimalDt(theValue); return this; }
public Number getValueAsNumber() { return getValue(); }
/** * Constructor */ @SimpleSetter public DecimalDt(@SimpleSetter.Parameter(name = "theValue") double theValue) { // Use the valueOf here because the constructor gives crazy precision // changes due to the floating point conversion setValue(BigDecimal.valueOf(theValue)); }
/** * Sets the value for <b>durationMax</b> () * * <p> * <b>Definition:</b> * The upper limit of how long this thing happens for when it happens * </p> */ public Repeat setDurationMax( java.math.BigDecimal theValue) { myDurationMax = new DecimalDt(theValue); return this; }
/** * Gets the value as an integer, using {@link BigDecimal#intValue()} */ public int getValueAsInteger() { return getValue().intValue(); }
/** * Constructor */ @SimpleSetter public DecimalDt(@SimpleSetter.Parameter(name = "theValue") long theValue) { setValue(new BigDecimal(theValue)); }
/** * Sets the value for <b>period</b> () * * <p> * <b>Definition:</b> * Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period * </p> */ public Repeat setPeriod( double theValue) { myPeriod = new DecimalDt(theValue); return this; }
@Override protected String encode(BigDecimal theValue) { return getValue().toPlainString(); }
/** * Rounds the value to the given prevision * * @see MathContext#getPrecision() * @see MathContext#getRoundingMode() */ public void round(int thePrecision, RoundingMode theRoundingMode) { if (getValue() != null) { BigDecimal newValue = getValue().round(new MathContext(thePrecision, theRoundingMode)); setValue(newValue); } }