Class CategoryUtil

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.text.DecimalFormat valueFormat
      Specifies how the category values should look.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatValue​(double value)
      Format an RTC value the way we want it.
      static java.lang.String getCategoryClass​(double normal, double warning, double value)
      Determine the CSS class to use for a given value and thresholds.
      static java.lang.String getCategoryClass​(Category category)
      Determine the CSS class to use for a given category value and thresholds.
      static java.lang.String getCategoryClass​(Category category, double value)
      Determine the CSS color to use for a given value and the given category's thresholds.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • valueFormat

        public static final java.text.DecimalFormat valueFormat
        Specifies how the category values should look.

        Note this value is currently public, but consider this temporary. To hide the implementation (so we can change it later), please call formatValueinstead.

    • Method Detail

      • formatValue

        public static java.lang.String formatValue​(double value)
        Format an RTC value the way we want it.
        Parameters:
        value - a double.
        Returns:
        a String object.
      • getCategoryClass

        public static java.lang.String getCategoryClass​(Category category)
                                                 throws java.io.IOException
        Determine the CSS class to use for a given category value and thresholds.
        Parameters:
        category - a Category object.
        Returns:
        a String object.
        Throws:
        java.io.IOException - if any.
      • getCategoryClass

        public static java.lang.String getCategoryClass​(Category category,
                                                        double value)
                                                 throws java.io.IOException
        Determine the CSS color to use for a given value and the given category's thresholds.
        Parameters:
        category - a Category object.
        value - a double.
        Returns:
        a String object.
        Throws:
        java.io.IOException - if any.
      • getCategoryClass

        public static java.lang.String getCategoryClass​(double normal,
                                                        double warning,
                                                        double value)
        Determine the CSS class to use for a given value and thresholds.
        Parameters:
        normal - a double.
        warning - a double.
        value - a double.
        Returns:
        a String object.