Interface Value<U extends Unit<U>,​T extends Value<U,​T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      U getDisplayUnit()
      Retrieve the unit of this Value.
      boolean isAbsolute()
      Indicate whether this is an Absolute Value.
      boolean isRelative()
      Indicate whether this is a Relative Value.
      void setDisplayUnit​(U newUnit)
      Set a new display unit for the value.
      String toString()
      Concise description of this value.
      String toString​(boolean verbose, boolean withUnit)
      Somewhat verbose description of this value with optional type and unit information.
      String toString​(U displayUnit)
      Somewhat verbose description of this value with the values expressed in the specified unit.
      String toString​(U displayUnit, boolean verbose, boolean withUnit)
      Somewhat verbose description of this value with the values expressed in the specified unit.
    • Method Detail

      • getDisplayUnit

        U getDisplayUnit()
        Retrieve the unit of this Value.
        Returns:
        U; the unit of this Value
      • setDisplayUnit

        void setDisplayUnit​(U newUnit)
        Set a new display unit for the value. Internally, the value will stay stored in the default or SI unit.
        Parameters:
        newUnit - U; the new display unit of this Value
      • isAbsolute

        boolean isAbsolute()
        Indicate whether this is an Absolute Value.
        Returns:
        boolean
      • isRelative

        boolean isRelative()
        Indicate whether this is a Relative Value.
        Returns:
        boolean
      • toString

        String toString()
        Concise description of this value.
        Overrides:
        toString in class Object
        Returns:
        a String with the value, non-verbose, with the unit attached.
      • toString

        String toString​(U displayUnit)
        Somewhat verbose description of this value with the values expressed in the specified unit.
        Parameters:
        displayUnit - U; the unit into which the values are converted for display
        Returns:
        String; printable string with the value contents expressed in the specified unit
      • toString

        String toString​(boolean verbose,
                        boolean withUnit)
        Somewhat verbose description of this value with optional type and unit information.
        Parameters:
        verbose - boolean; if true; include type info; if false; exclude type info
        withUnit - boolean; if true; include the unit; of false; exclude the unit
        Returns:
        String; printable string with the value contents
      • toString

        String toString​(U displayUnit,
                        boolean verbose,
                        boolean withUnit)
        Somewhat verbose description of this value with the values expressed in the specified unit.
        Parameters:
        displayUnit - U; the unit into which the values are converted for display
        verbose - boolean; if true; include type info; if false; exclude type info
        withUnit - boolean; if true; include the unit; of false; exclude the unit
        Returns:
        String; printable string with the value contents