Here you can find the source of clampInt(int value, int min, int max)
Parameter | Description |
---|---|
value | = the number to clamp |
max | = maximum possible value |
min | = minimum possible value |
public static int clampInt(int value, int min, int max)
//package com.java2s; //License from project: Open Source License public class Main { /**/* www . j a v a 2 s . com*/ * @param value = the number to clamp * @param max = maximum possible value * @param min = minimum possible value */ public static int clampInt(int value, int min, int max) { return (value < min) ? min : (value > max) ? max : value; } }