Class Range


  • public class Range
    extends java.lang.Object
    A value range of 'start' ... 'end' or 'lower' .. 'upper'.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double lower
      the lower value of range
      private double upper
      the upper value of range
    • Constructor Summary

      Constructors 
      Constructor Description
      Range​(double start, double end)
      Initialize with start...end values, sorting them to get lower...upper.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      double getLower()  
      double getUpper()  
      int hashCode()
      boolean inRange​(double value)
      If a value in the range or not.
      boolean inRange​(double value, boolean includeBoundary)
      If a value in the range or not.
      boolean isMinBigger()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • lower

        private final double lower
        the lower value of range
      • upper

        private final double upper
        the upper value of range
    • Constructor Detail

      • Range

        public Range​(double start,
                     double end)
        Initialize with start...end values, sorting them to get lower...upper.
        Parameters:
        start - the start value of range
        end - the end value of range
    • Method Detail

      • inRange

        public boolean inRange​(double value,
                               boolean includeBoundary)
        If a value in the range or not.
        Parameters:
        value -
        includeBoundary - true if the boundary should be considered.
        Returns:
        true if the value is in the range. Otherwise false.
      • inRange

        public boolean inRange​(double value)
        If a value in the range or not. The boundary is included.
        Parameters:
        value -
        Returns:
        true if the value is in the range. Otherwise false.
      • isMinBigger

        public boolean isMinBigger()
      • getLower

        public double getLower()
        Returns:
        the lower
      • getUpper

        public double getUpper()
        Returns:
        the upper
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object