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