Class NumberRange

  • All Implemented Interfaces:
    java.io.Serializable

    public class NumberRange
    extends java.lang.Object
    implements java.io.Serializable
    Class representing a range of number values.
    Since:
    8.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NumberRange()
      Creates a range of the number values.
      NumberRange​(double lower, double upper)
      Creates a range for the number values given.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Double getLowerBound()
      Returns the manually set lower bound of this range.
      java.lang.Double getUpperBound()
      Returns the manually set upper bound of this range.
      boolean isAutoRange()
      Returns whether or not the range will be defined automatically instead of using the manually set values.
      void setAutoRange​(boolean autoRange)
      Sets whether or not the range will be defined automatically instead of using the manually set values.
      void setLowerBound​(java.lang.Double lower)
      Manually sets the lower bound of this range.
      void setUpperBound​(java.lang.Double upper)
      Sets the manually set upper bound of this range.
      • Methods inherited from class java.lang.Object

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

      • NumberRange

        public NumberRange()
        Creates a range of the number values. The default state of this range is that it is to be generated automatically at run-time.
        Since:
        8.0
      • NumberRange

        public NumberRange​(double lower,
                           double upper)
        Creates a range for the number values given.
        Parameters:
        lower - the lower bound of range
        upper - the upper bound of range
        Throws:
        java.lang.IllegalArgumentException - if the upper value is less than the lower value
        Since:
        8.0
    • Method Detail

      • isAutoRange

        public boolean isAutoRange()
        Returns whether or not the range will be defined automatically instead of using the manually set values.
        Returns:
        the flag.
        Since:
        8.0
        See Also:
        setAutoRange(boolean)
      • setAutoRange

        public void setAutoRange​(boolean autoRange)
        Sets whether or not the range will be defined automatically instead of using the manually set values.
        Parameters:
        autoRange - whether the range will be defined automatically
        Since:
        8.0
        See Also:
        isAutoRange()
      • getLowerBound

        public java.lang.Double getLowerBound()
        Returns the manually set lower bound of this range. Note that this value will only be used if this range is set to not be automatic, but manual.
        Returns:
        the lower bound or null if this bound was not set
        Since:
        8.0
        See Also:
        setLowerBound(Double), setAutoRange(boolean)
      • setLowerBound

        public void setLowerBound​(java.lang.Double lower)
        Manually sets the lower bound of this range. Note that this value will only be used if this range is set to not be automatic, but manual.
        Parameters:
        lower - the lower bound of this range
        Throws:
        java.lang.IllegalArgumentException - if the parameter is greater than upper bound.
        Since:
        8.0
        See Also:
        getLowerBound()
      • getUpperBound

        public java.lang.Double getUpperBound()
        Returns the manually set upper bound of this range. Note that this value will only be used if this range is set to not be automatic, but manual.
        Returns:
        the upper bound or null if this bound was not set.
        Since:
        8.0
        See Also:
        setUpperBound(Double)
      • setUpperBound

        public void setUpperBound​(java.lang.Double upper)
        Sets the manually set upper bound of this range. Note that this value will only be used if this range is set to not be automatic, but manual.
        Parameters:
        upper - the upper bound of this range
        Throws:
        java.lang.IllegalArgumentException - if the parameter is less than lower bound.
        Since:
        8.0
        See Also:
        getUpperBound()