checkValueInInterval method

void checkValueInInterval (
  1. int value,
  2. int minValue,
  3. int maxValue,
  4. [String name,
  5. String message]
)

Check that a value lies in a specific interval.

Throws if value is not in the interval. The interval is from minValue to maxValue, both inclusive.

Implementation

static void checkValueInInterval(int value, int minValue, int maxValue,
    [String name, String message]) {
  if (value < minValue || value > maxValue) {
    throw RangeError.range(value, minValue, maxValue, name, message);
  }
}