Here you can find the source of clipInt(int value, int min, int max)
public static int clipInt(int value, int min, int max)
//package com.java2s; //License from project: Open Source License public class Main { public static int clipInt(int value, int min, int max) { if (value > max) value = max;/*from w w w. j a v a 2 s . c o m*/ if (value < min) value = min; return value; } public static int clipInt(int value, int max) { if (value > max) value = max; if (value < 0) value = 0; return value; } }