Package org.apache.commons.lang3

# Class DoubleRange

java.lang.Object
org.apache.commons.lang3.Range<N>
org.apache.commons.lang3.NumberRange<Double>
org.apache.commons.lang3.DoubleRange

All Implemented Interfaces:
  `Serializable`

public final class DoubleRange extends NumberRange<Double>
Specializes `NumberRange` for `Double`s.

This class is not designed to interoperate with other NumberRanges

Since:
  3.13.0
See Also:
  - Serialized Form

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DoubleRange`
  `of(double fromInclusive, double toInclusive)`
  Creates a range with the specified minimum and maximum values (both inclusive).
  `static DoubleRange`
  `of(Double fromInclusive, Double toInclusive)`
  Creates a range with the specified minimum and maximum values (both inclusive).

  ### Methods inherited from class org.apache.commons.lang3.Range

  `between, between, contains, containsRange, elementCompareTo, equals, fit, getComparator, getMaximum, getMinimum, hashCode, intersectionWith, is, is, isAfter, isAfterRange, isBefore, isBeforeRange, isEndedBy, isNaturalOrdering, isOverlappedBy, isStartedBy, of, of, toString, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### of

    public static DoubleRange of(double fromInclusive, double toInclusive)
    Creates a range with the specified minimum and maximum values (both inclusive).

    The range uses the natural ordering of the elements to determine where values lie in the range.

    The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values.

    Parameters:
      `fromInclusive` - the first value that defines the edge of the range, inclusive.
      `toInclusive` - the second value that defines the edge of the range, inclusive.
    Returns:
      the range object, not null.

  - ### of

    public static DoubleRange of(Double fromInclusive, Double toInclusive)
    Creates a range with the specified minimum and maximum values (both inclusive).

    The range uses the natural ordering of the elements to determine where values lie in the range.

    The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values.

    Parameters:
      `fromInclusive` - the first value that defines the edge of the range, inclusive.
      `toInclusive` - the second value that defines the edge of the range, inclusive.
    Returns:
      the range object, not null.
    Throws:
      `IllegalArgumentException` - if either element is null.