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