Package com.ibm.fhir.model.type
Class Quantity
- java.lang.Object
-
- com.ibm.fhir.model.visitor.AbstractVisitable
-
- com.ibm.fhir.model.type.Element
-
- com.ibm.fhir.model.type.Quantity
-
- All Implemented Interfaces:
Visitable
- Direct Known Subclasses:
Age,Count,Distance,Duration,MoneyQuantity,SimpleQuantity
@Generated("com.ibm.fhir.tools.CodeGenerator") public class Quantity extends Element
A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuantity.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protectedQuantity(Quantity.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(String elementName, int elementIndex, Visitor visitor)Accept a Visitor and invoke the appropriate visit methods.static Quantity.Builderbuilder()booleanequals(Object obj)CodegetCode()A computer processable form of the unit in some unit representation system.QuantityComparatorgetComparator()How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g.UrigetSystem()The identification of the system that provides the coded form of the unit.StringgetUnit()A human-readable form of the unit.DecimalgetValue()The value of the measured amount.booleanhasChildren()inthashCode()Quantity.BuildertoBuilder()Create a new Builder from the contents of this Element
-
-
-
Field Detail
-
value
protected final Decimal value
-
comparator
protected final QuantityComparator comparator
-
unit
protected final String unit
-
system
protected final Uri system
-
code
protected final Code code
-
-
Constructor Detail
-
Quantity
protected Quantity(Quantity.Builder builder)
-
-
Method Detail
-
getValue
public Decimal getValue()
The value of the measured amount. The value includes an implicit precision in the presentation of the value.- Returns:
- An immutable object of type
Decimalthat may be null.
-
getComparator
public QuantityComparator getComparator()
How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.- Returns:
- An immutable object of type
QuantityComparatorthat may be null.
-
getUnit
public String getUnit()
A human-readable form of the unit.- Returns:
- An immutable object of type
Stringthat may be null.
-
getSystem
public Uri getSystem()
The identification of the system that provides the coded form of the unit.- Returns:
- An immutable object of type
Urithat may be null.
-
getCode
public Code getCode()
A computer processable form of the unit in some unit representation system.- Returns:
- An immutable object of type
Codethat may be null.
-
hasChildren
public boolean hasChildren()
- Overrides:
hasChildrenin classElement
-
accept
public void accept(String elementName, int elementIndex, Visitor visitor)
Description copied from interface:VisitableAccept a Visitor and invoke the appropriate visit methods. A typical implementation would look like this:if (visitor.preVisit(this)) { visitor.visitStart(elementName, elementIndex, this); if (visitor.visit(elementName, elementIndex, this)) { // visit children } visitor.visitEnd(elementName, elementIndex, this); visitor.postVisit(this); }- Specified by:
acceptin interfaceVisitable- Specified by:
acceptin classAbstractVisitable- Parameters:
elementName- the name of the element in the context of this visitelementIndex- the index of the element in a list or -1 if it is not contained within a Listvisitor- the visitor to use
-
toBuilder
public Quantity.Builder toBuilder()
Description copied from class:ElementCreate a new Builder from the contents of this Element
-
builder
public static Quantity.Builder builder()
-
-