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