Interface Range<N extends Number>

Type Parameters:
N - number type
All Known Subinterfaces:
ByteRange, DoubleRange, FloatRange, IntRange, LongRange, ShortRange

@API(status=STABLE) public interface Range<N extends Number>
An inclusive range of numbers.
  • Method Details

    • min

      @NonNull N min()
      Returns the minimum value (inclusive).
      Returns:
      minimum value
    • max

      @NonNull N max()
      Returns the maximum value (inclusive).
      Returns:
      maximum value
    • byteRange

      static @NonNull ByteRange byteRange(byte min, byte max)
      Creates a new range.
      Parameters:
      min - min value
      max - max value
      Returns:
      the range
    • doubleRange

      static @NonNull DoubleRange doubleRange(double min, double max)
      Creates a new range.
      Parameters:
      min - min value
      max - max value
      Returns:
      the range
    • floatRange

      static @NonNull FloatRange floatRange(float min, float max)
      Creates a new range.
      Parameters:
      min - min value
      max - max value
      Returns:
      the range
    • intRange

      static @NonNull IntRange intRange(int min, int max)
      Creates a new range.
      Parameters:
      min - min value
      max - max value
      Returns:
      the range
    • longRange

      static @NonNull LongRange longRange(long min, long max)
      Creates a new range.
      Parameters:
      min - min value
      max - max value
      Returns:
      the range
    • shortRange

      static @NonNull ShortRange shortRange(short min, short max)
      Creates a new range.
      Parameters:
      min - min value
      max - max value
      Returns:
      the range