Package com.ibm.fhir.path
Class FHIRPathDecimalValue
- java.lang.Object
-
- com.ibm.fhir.path.FHIRPathAbstractNode
-
- com.ibm.fhir.path.FHIRPathDecimalValue
-
- All Implemented Interfaces:
FHIRPathNode
,FHIRPathNumberValue
,FHIRPathSystemValue
,Comparable<FHIRPathNode>
public class FHIRPathDecimalValue extends FHIRPathAbstractNode implements FHIRPathNumberValue
AFHIRPathNumberValue
node that wraps aBigDecimal
value
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FHIRPathDecimalValue.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protected
FHIRPathDecimalValue(FHIRPathDecimalValue.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(FHIRPathNodeVisitor visitor)
A method for accepting aFHIRPathNodeVisitor
FHIRPathNumberValue
add(FHIRPathNumberValue value)
Add this FHIRPathNumberValue to another FHIRPathNumber valuestatic FHIRPathDecimalValue.Builder
builder(BigDecimal decimal)
Static factory method for creating builder instances from aBigDecimal
valueBigDecimal
decimal()
TheBigDecimal
value wrapped by this FHIRPathNumberValuestatic FHIRPathDecimalValue
decimalValue(String name, BigDecimal decimal)
Static factory method for creating named FHIRPathDecimalValue instances from aBigDecimal
valuestatic FHIRPathDecimalValue
decimalValue(BigDecimal decimal)
Static factory method for creating FHIRPathDecimalValue instances from aBigDecimal
valueFHIRPathNumberValue
div(FHIRPathNumberValue value)
Divide this FHIRPathNumberValue by another FHIRPathNumberValue and convert the result to an integerFHIRPathNumberValue
divide(FHIRPathNumberValue value)
Divide this FHIRPathNumberValue by another FHIRPathNumberValueboolean
equals(Object obj)
Indicates whether the decimal value wrapped by this FHIRPathDecimalValue node is equal the parameter (or its primitive value)int
hashCode()
Integer
integer()
TheInteger
value wrapped by this FHIRPathNumberValueboolean
isDecimalValue()
Indicates whether this FHIRPathNumberValue is aFHIRPathDecimalValue
FHIRPathNumberValue
mod(FHIRPathNumberValue value)
Compute the remainder resulting from the integer division of this FHIRPathNumberValue by another FHIRPathNumberValueFHIRPathNumberValue
multiply(FHIRPathNumberValue value)
Multiply this FHIRPathNumberValue by another FHIRPathNumberValueFHIRPathNumberValue
negate()
Negate this FHIRPathNumberValueFHIRPathNumberValue
plus()
The inverse of negate (for symmetry)FHIRPathNumberValue
subtract(FHIRPathNumberValue value)
Subtract another FHIRPathNumberValue from this FHIRPathNumberValueFHIRPathDecimalValue.Builder
toBuilder()
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instanceString
toString()
-
Methods inherited from class com.ibm.fhir.path.FHIRPathAbstractNode
as, children, descendants, getValue, hasValue, is, name, path, stream, type
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathNode
as, asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, children, descendants, getValue, is, isElementNode, isResourceNode, isTermServiceNode, isTypeInfoNode, name, path, stream, type
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathNumberValue
asDecimalValue, asIntegerValue, compareTo, isComparableTo, isIntegerValue, isNumberValue, number
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathSystemValue
asBooleanValue, asNumberValue, asQuantityValue, asStringValue, asTemporalValue, hasValue, isBooleanValue, isQuantityValue, isStringValue, isSystemValue, isTemporalValue
-
-
-
-
Constructor Detail
-
FHIRPathDecimalValue
protected FHIRPathDecimalValue(FHIRPathDecimalValue.Builder builder)
-
-
Method Detail
-
isDecimalValue
public boolean isDecimalValue()
Description copied from interface:FHIRPathNumberValue
Indicates whether this FHIRPathNumberValue is aFHIRPathDecimalValue
- Specified by:
isDecimalValue
in interfaceFHIRPathNumberValue
- Returns:
- true if this FHIRPathNumberValue is a
FHIRPathDecimalValue
-
decimal
public BigDecimal decimal()
Description copied from interface:FHIRPathNumberValue
TheBigDecimal
value wrapped by this FHIRPathNumberValue- Specified by:
decimal
in interfaceFHIRPathNumberValue
- Returns:
- the
BigDecimal
value wrapped by this FHIRPathNumberValue
-
integer
public Integer integer()
Description copied from interface:FHIRPathNumberValue
TheInteger
value wrapped by this FHIRPathNumberValue- Specified by:
integer
in interfaceFHIRPathNumberValue
- Returns:
- the
Integer
value wrapped by this FHIRPathNumberValue
-
decimalValue
public static FHIRPathDecimalValue decimalValue(BigDecimal decimal)
Static factory method for creating FHIRPathDecimalValue instances from aBigDecimal
value- Parameters:
decimal
- theBigDecimal
value- Returns:
- a new FHIRPathDecimalValue instance
-
decimalValue
public static FHIRPathDecimalValue decimalValue(String name, BigDecimal decimal)
Static factory method for creating named FHIRPathDecimalValue instances from aBigDecimal
value- Parameters:
name
- the namedecimal
- theBigDecimal
value- Returns:
- a new named FHIRPathDecimalValue instance
-
toBuilder
public FHIRPathDecimalValue.Builder toBuilder()
Description copied from class:FHIRPathAbstractNode
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instance- Specified by:
toBuilder
in classFHIRPathAbstractNode
- Returns:
- a new
FHIRPathNode.Builder
instance containing the fields from thisFHIRPathNode
instance
-
builder
public static FHIRPathDecimalValue.Builder builder(BigDecimal decimal)
Static factory method for creating builder instances from aBigDecimal
value- Parameters:
decimal
- theBigDecimal
value- Returns:
- a new builder for building FHIRPathDecimalValue instances
-
add
public FHIRPathNumberValue add(FHIRPathNumberValue value)
Description copied from interface:FHIRPathNumberValue
Add this FHIRPathNumberValue to another FHIRPathNumber value- Specified by:
add
in 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:FHIRPathNumberValue
Subtract another FHIRPathNumberValue from this FHIRPathNumberValue- Specified by:
subtract
in 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:FHIRPathNumberValue
Multiply this FHIRPathNumberValue by another FHIRPathNumberValue- Specified by:
multiply
in 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:FHIRPathNumberValue
Divide this FHIRPathNumberValue by another FHIRPathNumberValue- Specified by:
divide
in 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:FHIRPathNumberValue
Divide this FHIRPathNumberValue by another FHIRPathNumberValue and convert the result to an integer- Specified by:
div
in 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:FHIRPathNumberValue
Compute the remainder resulting from the integer division of this FHIRPathNumberValue by another FHIRPathNumberValue- Specified by:
mod
in 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:FHIRPathNumberValue
Negate this FHIRPathNumberValue- Specified by:
negate
in interfaceFHIRPathNumberValue
- Returns:
- the result of negating this FHIRPathNumber
-
plus
public FHIRPathNumberValue plus()
Description copied from interface:FHIRPathNumberValue
The inverse of negate (for symmetry)- Specified by:
plus
in interfaceFHIRPathNumberValue
- Returns:
- this FHIRPathNumberValue
-
equals
public boolean equals(Object obj)
Indicates whether the decimal value wrapped by this FHIRPathDecimalValue node is equal the parameter (or its primitive value)
-
accept
public void accept(FHIRPathNodeVisitor visitor)
Description copied from interface:FHIRPathNode
A method for accepting aFHIRPathNodeVisitor
- Specified by:
accept
in interfaceFHIRPathNode
- Parameters:
visitor
- theFHIRPathNodeVisitor
that this FHIRPathNode is accepting
-
-