Class RangeFactory

Object
RangeFactory

public class RangeFactory extends Object
This class is a factory class which creates a Range object for the specific data type. This Range can have 2 bounds or be a single-point range. If the 2 bound values are equal and almost one of them is included, then a single-point range is created, else an exception is thrown. If the minimum bound value is bigger than the maximum value, then the 2 numbers are inverted at the Range creation time.
  • Method Details

    • create

      public static RangeByte create(byte minValue, boolean minIncluded, byte maxValue, boolean maxIncluded)
    • createU

      public static RangeUshort createU(short minValue, boolean minIncluded, short maxValue, boolean maxIncluded)
    • create

      public static RangeShort create(short minValue, boolean minIncluded, short maxValue, boolean maxIncluded)
    • create

      public static RangeInt create(int minValue, boolean minIncluded, int maxValue, boolean maxIncluded)
    • create

      public static RangeFloat create(float minValue, boolean minIncluded, float maxValue, boolean maxIncluded, boolean nanIncluded)
    • create

      public static RangeDouble create(double minValue, boolean minIncluded, double maxValue, boolean maxIncluded, boolean nanIncluded)
    • create

      public static RangeByte create(byte minValue, byte maxValue)
    • createU

      public static RangeUshort createU(short minValue, short maxValue)
    • create

      public static RangeShort create(short minValue, short maxValue)
    • create

      public static RangeInt create(int minValue, int maxValue)
    • create

      public static RangeFloat create(float minValue, float maxValue)
    • create

      public static RangeDouble create(double minValue, double maxValue)
    • create

      public static RangeFloat create(float minValue, boolean minIncluded, float maxValue, boolean maxIncluded)
    • create

      public static RangeDouble create(double minValue, boolean minIncluded, double maxValue, boolean maxIncluded)
    • create

      public static RangeLong create(long minValue, boolean minIncluded, long maxValue, boolean maxIncluded)
    • convertToDoubleRange

      public static RangeDouble convertToDoubleRange(Range input)
      Convert to RangeDouble casting or creating a copy if needed.
      Parameters:
      input - Range
      Returns:
      RangeDouble
    • convertToFloatRange

      public static RangeFloat convertToFloatRange(Range input)
      Convert to RangeFloat casting or creating a copy if needed.
      Parameters:
      input - Range
      Returns:
      RangeFloat
    • convert

      public static Range convert(Range input, Range.DataType dataType)
      Convert to Range of the specified data type, casting or creating a copy if needed.
      Parameters:
      input - Range to convert
      dataType - DataType for conversion
      Returns:
      Converted Range instance
    • convert

      public static Range convert(Range input, int dataType)
      Convert to Range of the specified DataBuffer type. Conversion is done as a cast if possible, otherwise a new Range is created.
      Parameters:
      input - Range to convert
      dataType - DataBuffer dataType
      Returns:
      Converted Range instance
    • convertToByteRange

      public static RangeByte convertToByteRange(Range input)
    • subtract

      public static List<Range> subtract(Range r1, Range r2)
    • intersect

      public static Range intersect(Range r1, Range r2)
    • equals

      public static boolean equals(double d1, double d2)