diff options
Diffstat (limited to 'core/java/android/util/MathUtils.java')
| -rw-r--r-- | core/java/android/util/MathUtils.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/util/MathUtils.java b/core/java/android/util/MathUtils.java index b35dd1eac0de..13a692ea18c9 100644 --- a/core/java/android/util/MathUtils.java +++ b/core/java/android/util/MathUtils.java @@ -39,6 +39,10 @@ public final class MathUtils { return amount < low ? low : (amount > high ? high : amount); } + public static long constrain(long amount, long low, long high) { + return amount < low ? low : (amount > high ? high : amount); + } + public static float constrain(float amount, float low, float high) { return amount < low ? low : (amount > high ? high : amount); } |
