Class Ranges


  • public class Ranges
    extends Object
    Utility classes to compute ranges.
    Author:
    carcassi
    • Constructor Detail

      • Ranges

        public Ranges()
    • Method Detail

      • absRange

        public static Range absRange​(Range range)
        Returns the range of the absolute values within the range.

        If the range is all positive, it returns the same range.

        Parameters:
        range - a range
        Returns:
        the range of the absolute values
      • overlap

        public static double overlap​(Range range,
                                     Range otherRange)
        Percentage, from 0 to 1, of the first range that is contained by the second range.
        Parameters:
        range - the range to be contained by the second
        otherRange - the range that has to contain the first
        Returns:
        from 0 (if there is no intersection) to 1 (if the ranges are the same)