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