Class Threshold


  • public final class Threshold
    extends Object
    Is the threshold to use for gauge chart.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • Threshold

        public Threshold​(String name,
                         IsColor color)
        Creates a threshold with standard value (Double.MAX_VALUE).
        Parameters:
        name - name of threshold
        color - color of threshold
      • Threshold

        public Threshold​(String name,
                         double value)
        Creates a threshold with standard color (DEFAULT_VALUE_COLOR).
        Parameters:
        name - name of threshold
        value - value of threshold
      • Threshold

        public Threshold​(String name,
                         double value,
                         IsColor color)
        Creates a threshold
        Parameters:
        name - name of threshold
        value - value of threshold
        color - color of threshold
    • Method Detail

      • getName

        public String getName()
      • getValue

        public double getValue()
      • getColor

        public IsColor getColor()
      • setValue

        public Threshold setValue​(double value)
        Sets the value of threshold.
        Parameters:
        value - the value to set
        Returns:
        the threshold instance
      • setColor

        public Threshold setColor​(IsColor color)
        Sets the color of threshold.
        Parameters:
        color - the color to set
        Returns:
        the threshold instance
      • isInRange

        public boolean isInRange​(double valueToCheck,
                                 double lowLimit)
        Checks if the value passed is in the threshold.
        Parameters:
        valueToCheck - value to check
        lowLimit - the low limit
        Returns:
        true is the value is inside the range, otherwise false.