public static int restrictRange ( int value , int min , int max ) { return Math . min ( ( Math . max ( value , min ) ) , max ) ; }
If the specified value is not greater than or equal to the specified minimum and less than or equal to the specified maximum adjust it so that it is .