Package com.ibm.fhir.path
Class FHIRPathQuantityNode
- java.lang.Object
-
- com.ibm.fhir.path.FHIRPathAbstractNode
-
- com.ibm.fhir.path.FHIRPathElementNode
-
- com.ibm.fhir.path.FHIRPathQuantityNode
-
- All Implemented Interfaces:
FHIRPathNode,Comparable<FHIRPathNode>
public class FHIRPathQuantityNode extends FHIRPathElementNode
AFHIRPathElementNodethat wraps aQuantity
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFHIRPathQuantityNode.Builder
-
Field Summary
-
Fields inherited from class com.ibm.fhir.path.FHIRPathElementNode
element, tree
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFHIRPathQuantityNode(FHIRPathQuantityNode.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FHIRPathQuantityNodeadd(FHIRPathQuantityNode node)Add this FHIRPathQuantityNode to another FHIRPathQuantityNodestatic FHIRPathQuantityNode.Builderbuilder(Quantity quantity)Static factory method for creating builder instances from aQuantityvalueintcompareTo(FHIRPathNode other)Compare the quantity value wrapped by this FHIRPathQuantityNode to the parameterbooleanequals(Object obj)Indicates whether the quantity value wrapped by this FHIRPathQuantityNode is equal the parameter (or its primitive value)StringgetQuantityCode()The code of the quantity wrapped by this FHIRPathQuantityNodeStringgetQuantitySystem()The system of the quantity wrapped by this FHIRPathQuantityNodeStringgetQuantityUnit()The unit of the quantity wrapped by this FHIRPathQuantityNodeBigDecimalgetQuantityValue()TheBigDecimalvalue of the quantity wrapped by this FHIRPathQuantityNodebooleanisComparableTo(FHIRPathNode other)Indicates whether this FHIRPathQuantityNode is comparable to the parameterbooleanisQuantityNode()Indicates whether this FHIRPathElementNode is type compatible withFHIRPathQuantityNodeQuantityquantity()The quantity wrapped by this FHIRPathQuantityNodeFHIRPathQuantityNodesubtract(FHIRPathQuantityNode node)Subtract another FHIRPathQuantityNode from this FHIRPathQuantityNodeStringtoString()-
Methods inherited from class com.ibm.fhir.path.FHIRPathElementNode
accept, asQuantityNode, builder, element, elementNode, elementNode, getTree, hashCode, isElementNode, toBuilder
-
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
asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, isResourceNode, isSystemValue, isTermServiceNode, isTypeInfoNode
-
-
-
-
Constructor Detail
-
FHIRPathQuantityNode
protected FHIRPathQuantityNode(FHIRPathQuantityNode.Builder builder)
-
-
Method Detail
-
quantity
public Quantity quantity()
The quantity wrapped by this FHIRPathQuantityNode- Returns:
- the quantity wrapped by this FHIRPathQuantityNode
-
getQuantitySystem
public String getQuantitySystem()
The system of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the system of the quantity wrapped by this FHIRPathQuantityNode
-
getQuantityCode
public String getQuantityCode()
The code of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the code of the quantity wrapped by this FHIRPathQuantityNode
-
getQuantityUnit
public String getQuantityUnit()
The unit of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the unit of the quantity wrapped by this FHIRPathQuantityNode
-
getQuantityValue
public BigDecimal getQuantityValue()
TheBigDecimalvalue of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the
BigDecimalvalue of the quantity wrapped by this FHIRPathQuantityNode
-
isQuantityNode
public boolean isQuantityNode()
Description copied from class:FHIRPathElementNodeIndicates whether this FHIRPathElementNode is type compatible withFHIRPathQuantityNode- Overrides:
isQuantityNodein classFHIRPathElementNode- Returns:
- true if this FHIRPathElementNode is type compatible with
FHIRPathQuantityNode, otherwise false
-
builder
public static FHIRPathQuantityNode.Builder builder(Quantity quantity)
Static factory method for creating builder instances from aQuantityvalue- Parameters:
quantity- theQuantityvalue- Returns:
- a new builder for building FHIRPathQuantityNode instances
-
add
public FHIRPathQuantityNode add(FHIRPathQuantityNode node)
Add this FHIRPathQuantityNode to another FHIRPathQuantityNode- Parameters:
node- the other FHIRPathQuantityNode- Returns:
- the result of adding this FHIRPathQuantityNode to another FHIRPathQuantityNode
-
subtract
public FHIRPathQuantityNode subtract(FHIRPathQuantityNode node)
Subtract another FHIRPathQuantityNode from this FHIRPathQuantityNode- Parameters:
node- the other FHIRPathQuantityNode- Returns:
- the result of subtracting another FHIRPathQuantityNode from this FHIRPathQuantityNode
-
isComparableTo
public boolean isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathQuantityNode is comparable to the parameter- Specified by:
isComparableToin interfaceFHIRPathNode- Overrides:
isComparableToin classFHIRPathElementNode- Parameters:
other- the otherFHIRPathNode- Returns:
- true if the parameter or its primitive value is a FHIRPathQuantityNode, a
FHIRPathQuantityValueor a , otherwise false
-
compareTo
public int compareTo(FHIRPathNode other)
Compare the quantity value wrapped by this FHIRPathQuantityNode to the parameter- Specified by:
compareToin interfaceComparable<FHIRPathNode>- Overrides:
compareToin classFHIRPathElementNode- Parameters:
other- the otherFHIRPathNode- Returns:
- 0 if the quantity value wrapped by this FHIRPathQuantity is equal to the parameter; a positive value if this FHIRPathQuantityNode is greater than the parameter; and a negative value if this FHIRPathQuantityNode is less than the parameter
-
equals
public boolean equals(Object obj)
Indicates whether the quantity value wrapped by this FHIRPathQuantityNode is equal the parameter (or its primitive value)- Overrides:
equalsin classFHIRPathElementNode- Parameters:
obj- the otherObject- Returns:
- true if the quantity value wrapped by this FHIRPathQuantityNode node is equal the parameter (or its primitive value), otherwise false
-
toString
public String toString()
- Overrides:
toStringin classFHIRPathElementNode
-
-