Package org.linuxforhealth.fhir.path
Class FHIRPathDecimalValue
- java.lang.Object
-
- org.linuxforhealth.fhir.path.FHIRPathAbstractNode
-
- org.linuxforhealth.fhir.path.FHIRPathAbstractSystemValue
-
- org.linuxforhealth.fhir.path.FHIRPathDecimalValue
-
- All Implemented Interfaces:
java.lang.Comparable<FHIRPathNode>,FHIRPathNode,FHIRPathNumberValue,FHIRPathSystemValue
public class FHIRPathDecimalValue extends FHIRPathAbstractSystemValue implements FHIRPathNumberValue
AFHIRPathNumberValuenode that wraps aBigDecimalvalue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFHIRPathDecimalValue.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protectedFHIRPathDecimalValue(FHIRPathDecimalValue.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(FHIRPathNodeVisitor visitor)A method for accepting aFHIRPathNodeVisitorFHIRPathNumberValueadd(FHIRPathNumberValue value)Add this FHIRPathNumberValue to another FHIRPathNumber valuestatic FHIRPathDecimalValue.Builderbuilder(java.math.BigDecimal decimal)Static factory method for creating builder instances from aBigDecimalvaluejava.math.BigDecimaldecimal()TheBigDecimalvalue wrapped by this FHIRPathNumberValuestatic FHIRPathDecimalValuedecimalValue(java.lang.String path, java.lang.String name, java.math.BigDecimal decimal)Static factory method for creating named FHIRPathDecimalValue instances from aBigDecimalvaluestatic FHIRPathDecimalValuedecimalValue(java.math.BigDecimal decimal)Static factory method for creating FHIRPathDecimalValue instances from aBigDecimalvalueFHIRPathNumberValuediv(FHIRPathNumberValue value)Divide this FHIRPathNumberValue by another FHIRPathNumberValue and convert the result to an integerFHIRPathNumberValuedivide(FHIRPathNumberValue value)Divide this FHIRPathNumberValue by another FHIRPathNumberValuebooleanequals(java.lang.Object obj)Indicates whether the decimal value wrapped by this FHIRPathDecimalValue node is equal the parameter (or its primitive value)inthashCode()java.lang.Integerinteger()TheIntegervalue wrapped by this FHIRPathNumberValuebooleanisDecimalValue()Indicates whether this FHIRPathNumberValue is aFHIRPathDecimalValueFHIRPathNumberValuemod(FHIRPathNumberValue value)Compute the remainder resulting from the integer division of this FHIRPathNumberValue by another FHIRPathNumberValueFHIRPathNumberValuemultiply(FHIRPathNumberValue value)Multiply this FHIRPathNumberValue by another FHIRPathNumberValueFHIRPathNumberValuenegate()Negate this FHIRPathNumberValueFHIRPathNumberValueplus()The inverse of negate (for symmetry)FHIRPathNumberValuesubtract(FHIRPathNumberValue value)Subtract another FHIRPathNumberValue from this FHIRPathNumberValueFHIRPathDecimalValue.BuildertoBuilder()Convert thisFHIRPathNodeinstance into aFHIRPathNode.Builderinstancejava.lang.StringtoString()-
Methods inherited from class org.linuxforhealth.fhir.path.FHIRPathAbstractSystemValue
children, descendants, stream
-
Methods inherited from class org.linuxforhealth.fhir.path.FHIRPathAbstractNode
as, getValue, hasValue, is, name, path, type
-
Methods inherited from interface org.linuxforhealth.fhir.path.FHIRPathNode
as, asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, children, descendants, is, isElementNode, isResourceNode, isTermServiceNode, isTypeInfoNode, name, path, stream, type
-
Methods inherited from interface org.linuxforhealth.fhir.path.FHIRPathNumberValue
asDecimalValue, asIntegerValue, compareTo, isComparableTo, isIntegerValue, isNumberValue, number
-
Methods inherited from interface org.linuxforhealth.fhir.path.FHIRPathSystemValue
asBooleanValue, asNumberValue, asQuantityValue, asStringValue, asTemporalValue, getValue, hasValue, isBooleanValue, isQuantityValue, isStringValue, isSystemValue, isTemporalValue
-
-
-
-
Constructor Detail
-
FHIRPathDecimalValue
protected FHIRPathDecimalValue(FHIRPathDecimalValue.Builder builder)
-
-
Method Detail
-
isDecimalValue
public boolean isDecimalValue()
Description copied from interface:FHIRPathNumberValueIndicates whether this FHIRPathNumberValue is aFHIRPathDecimalValue- Specified by:
isDecimalValuein interfaceFHIRPathNumberValue- Returns:
- true if this FHIRPathNumberValue is a
FHIRPathDecimalValue
-
decimal
public java.math.BigDecimal decimal()
Description copied from interface:FHIRPathNumberValueTheBigDecimalvalue wrapped by this FHIRPathNumberValue- Specified by:
decimalin interfaceFHIRPathNumberValue- Returns:
- the
BigDecimalvalue wrapped by this FHIRPathNumberValue
-
integer
public java.lang.Integer integer()
Description copied from interface:FHIRPathNumberValueTheIntegervalue wrapped by this FHIRPathNumberValue- Specified by:
integerin interfaceFHIRPathNumberValue- Returns:
- the
Integervalue wrapped by this FHIRPathNumberValue
-
decimalValue
public static FHIRPathDecimalValue decimalValue(java.math.BigDecimal decimal)
Static factory method for creating FHIRPathDecimalValue instances from aBigDecimalvalue- Parameters:
decimal- theBigDecimalvalue- Returns:
- a new FHIRPathDecimalValue instance
-
decimalValue
public static FHIRPathDecimalValue decimalValue(java.lang.String path, java.lang.String name, java.math.BigDecimal decimal)
Static factory method for creating named FHIRPathDecimalValue instances from aBigDecimalvalue- Parameters:
path- the path of the FHIRPathNodename- the namedecimal- theBigDecimalvalue- Returns:
- a new named FHIRPathDecimalValue instance
-
toBuilder
public FHIRPathDecimalValue.Builder toBuilder()
Description copied from class:FHIRPathAbstractNodeConvert thisFHIRPathNodeinstance into aFHIRPathNode.Builderinstance- Specified by:
toBuilderin classFHIRPathAbstractSystemValue- Returns:
- a new
FHIRPathNode.Builderinstance containing the fields from thisFHIRPathNodeinstance
-
builder
public static FHIRPathDecimalValue.Builder builder(java.math.BigDecimal decimal)
Static factory method for creating builder instances from aBigDecimalvalue- Parameters:
decimal- theBigDecimalvalue- Returns:
- a new builder for building FHIRPathDecimalValue instances
-
add
public FHIRPathNumberValue add(FHIRPathNumberValue value)
Description copied from interface:FHIRPathNumberValueAdd this FHIRPathNumberValue to another FHIRPathNumber value- Specified by:
addin interfaceFHIRPathNumberValue- Parameters:
value- the other FHIRPathNumber value- Returns:
- the result of adding this FHIRPathNumberValue to another FHIRPathNumberValue
-
subtract
public FHIRPathNumberValue subtract(FHIRPathNumberValue value)
Description copied from interface:FHIRPathNumberValueSubtract another FHIRPathNumberValue from this FHIRPathNumberValue- Specified by:
subtractin interfaceFHIRPathNumberValue- Parameters:
value- the other FHIRPathNumberValue- Returns:
- the result of subtracting another FHIRPathNumberValue from this FHIRPathNumberValue
-
multiply
public FHIRPathNumberValue multiply(FHIRPathNumberValue value)
Description copied from interface:FHIRPathNumberValueMultiply this FHIRPathNumberValue by another FHIRPathNumberValue- Specified by:
multiplyin interfaceFHIRPathNumberValue- Parameters:
value- the other FHIRPathNumberValue- Returns:
- the result of multiplying this FHIRPathNumberValue by another FHIRPathNumberValue
-
divide
public FHIRPathNumberValue divide(FHIRPathNumberValue value)
Description copied from interface:FHIRPathNumberValueDivide this FHIRPathNumberValue by another FHIRPathNumberValue- Specified by:
dividein interfaceFHIRPathNumberValue- Parameters:
value- the other FHIRPathNumberValue- Returns:
- the result of dividing this FHIRPathNumberValue by another FHIRPathNumberValue
-
div
public FHIRPathNumberValue div(FHIRPathNumberValue value)
Description copied from interface:FHIRPathNumberValueDivide this FHIRPathNumberValue by another FHIRPathNumberValue and convert the result to an integer- Specified by:
divin interfaceFHIRPathNumberValue- Parameters:
value- the other FHIRPathNumberValue- Returns:
- the result of dividing this FHIRPathNumberValue by another FHIRPathNumberValue and converting the result to an integer
-
mod
public FHIRPathNumberValue mod(FHIRPathNumberValue value)
Description copied from interface:FHIRPathNumberValueCompute the remainder resulting from the integer division of this FHIRPathNumberValue by another FHIRPathNumberValue- Specified by:
modin interfaceFHIRPathNumberValue- Parameters:
value- the other FHIRPathNumberValue- Returns:
- the integer remainder resulting from the division of this FHIRPathNumberValue by another FHIRPathNumberValue
-
negate
public FHIRPathNumberValue negate()
Description copied from interface:FHIRPathNumberValueNegate this FHIRPathNumberValue- Specified by:
negatein interfaceFHIRPathNumberValue- Returns:
- the result of negating this FHIRPathNumber
-
plus
public FHIRPathNumberValue plus()
Description copied from interface:FHIRPathNumberValueThe inverse of negate (for symmetry)- Specified by:
plusin interfaceFHIRPathNumberValue- Returns:
- this FHIRPathNumberValue
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether the decimal value wrapped by this FHIRPathDecimalValue node is equal the parameter (or its primitive value)- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the otherObject- Returns:
- true if the decimal value wrapped by this FHIRPathDecimalValue node is equal the parameter (or its primitive value), otherwise false
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public void accept(FHIRPathNodeVisitor visitor)
Description copied from interface:FHIRPathNodeA method for accepting aFHIRPathNodeVisitor- Specified by:
acceptin interfaceFHIRPathNode- Parameters:
visitor- theFHIRPathNodeVisitorthat this FHIRPathNode is accepting
-
-