Class 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.
    • 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 Decimal that 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 QuantityComparator that may be null.
      • getUnit

        public String getUnit()
        A human-readable form of the unit.
        Returns:
        An immutable object of type String that 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 Uri that 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 Code that may be null.
      • accept

        public void accept​(String elementName,
                           int elementIndex,
                           Visitor visitor)
        Description copied from interface: Visitable
        Accept 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:
        accept in interface Visitable
        Specified by:
        accept in class AbstractVisitable
        Parameters:
        elementName - the name of the element in the context of this visit
        elementIndex - the index of the element in a list or -1 if it is not contained within a List
        visitor - the visitor to use
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object