Enum Unit

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Unit>

    public enum Unit
    extends java.lang.Enum<Unit>
    Telemetry unit used in the TelemetryFormat annotation.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BYTES
      The monitored value has the unit "bytes".
      MICROSECONDS
      The monitored value has the unit "microseconds".
      MILLISECONDS
      The monitored value has the unit "milliseconds".
      NANOSECONDS
      The monitored value has the unit "nanoseconds".
      PER_SECOND
      The monitored value has the unit "per second".
      PERCENT
      The monitored value has the unit "percent".
      PLAIN
      The monitored value is a unitless number.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Unit valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Unit[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • PLAIN

        public static final Unit PLAIN
        The monitored value is a unitless number.
      • PER_SECOND

        public static final Unit PER_SECOND
        The monitored value has the unit "per second". Conversion into the units "per-minute" and "per-hour" is done automatically as required. In practice, this conversion would occur if TelemetryFormat.scale() is set to a negative number.
      • PERCENT

        public static final Unit PERCENT
        The monitored value has the unit "percent". To show two decimal digits, set TelemetryFormat.scale() to 2.
      • MILLISECONDS

        public static final Unit MILLISECONDS
        The monitored value has the unit "milliseconds". Conversion into higher unit prefixes such as seconds, or minutes is done automatically as required.
      • MICROSECONDS

        public static final Unit MICROSECONDS
        The monitored value has the unit "microseconds". Conversion into higher unit prefixes such as seconds, or minutes is done automatically as required.
      • NANOSECONDS

        public static final Unit NANOSECONDS
        The monitored value has the unit "nanoseconds". Conversion into higher unit prefixes such as microseconds or milliseconds is done automatically as required.
      • BYTES

        public static final Unit BYTES
        The monitored value has the unit "bytes". Conversion into higher unit prefixes such as kB, MB or GB is done automatically as required.
    • Method Detail

      • values

        public static Unit[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Unit c : Unit.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Unit valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null