List of utility methods to do Integer Clamp
int | clamp(int value, int min, int max) clamp if (value < min) { return min; if (value > max) { return max; return value; |
int | clamp(int value, int min, int max) clamp if (value < min) return min; if (value > max) return max; return value; |
int | clamp(int value, int min, int max) Clamps the value to a discrete value if (value < min) value = min; if (value > max) value = max; return value; |
int | clamp(int value, int min, int max) Clamp Integer values to a given range return Math.max(min, Math.min(max, value));
|
int | clamp(int value, int min, int max) clamp int clamped = min > value ? min : value; return max < clamped ? max : clamped; |
int | clamp(int value, int min, int max) Clamp the provided value to the range specified by [min, max]
if (min > max) { return clamp(value, max, min); return Math.max(min, Math.min(max, value)); |
int | clamp(int value, int min, int max) Fix a value between an interval. final int fixed; if (value < min) { fixed = min; } else if (value > max) { fixed = max; } else { fixed = value; return fixed; |
int | clamp(int value, int minValue, int maxValue) Limit an integer value to a specific range. return Math.max(minValue, Math.min(value, maxValue));
|
int | clamp(int var, int min, int max) Clamp a value, I.E. if (var >= max) { return max; } else if (var <= min) { return min; } else { return var; |
int | clamp(int x, int min, int max) Clamps an int value to a given range. if (x < min) return min; if (x > max) return max; return x; |