Class AbstractValue<U extends Unit<U>,​T extends Value<U,​T>>

    • Constructor Detail

      • AbstractValue

        protected AbstractValue​(U displayUnit)
        Construct a new AbstractValue.
        Parameters:
        displayUnit - U; the unit of the new AbstractValue
    • Method Detail

      • getDisplayUnit

        public final U getDisplayUnit()
        Retrieve the unit of this Value.
        Specified by:
        getDisplayUnit in interface Value<U extends Unit<U>,​T extends Value<U,​T>>
        Returns:
        U; the unit of this Value
      • setDisplayUnit

        public void setDisplayUnit​(U newUnit)
        Set a new display unit for the value. Internally, the value will stay stored in the default or SI unit.
        Specified by:
        setDisplayUnit in interface Value<U extends Unit<U>,​T extends Value<U,​T>>
        Parameters:
        newUnit - U; the new display unit of this Value
      • isAbsolute

        public final boolean isAbsolute()
        Indicate whether this is an Absolute Value.
        Specified by:
        isAbsolute in interface Value<U extends Unit<U>,​T extends Value<U,​T>>
        Returns:
        boolean
      • isRelative

        public final boolean isRelative()
        Indicate whether this is a Relative Value.
        Specified by:
        isRelative in interface Value<U extends Unit<U>,​T extends Value<U,​T>>
        Returns:
        boolean