Java Integer Clamp clampInt(int value, int min, int max)

Here you can find the source of clampInt(int value, int min, int max)

Description

clamp Int

License

Open Source License

Parameter

Parameter Description
value = the number to clamp
max = maximum possible value
min = minimum possible value

Declaration

public static int clampInt(int value, int min, int max) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/* www  . j a v  a  2 s  .  com*/
     * @param value = the number to clamp
     * @param max   = maximum possible value
     * @param min   = minimum possible value
     */
    public static int clampInt(int value, int min, int max) {
        return (value < min) ? min : (value > max) ? max : value;
    }
}

Related

  1. clampColorInt(int color)
  2. CLAMPED_Wr(long ITERW, int FBZCP)
  3. clampI(int a, int min, int max)
  4. clampInt(final int min, final int max, final int value)
  5. clampInt(final int min, final int value, final int max)
  6. clampInt(int value, int min, int max)
  7. CLAMPIS(int a, int b, int c)
  8. clampLoop(int v, int min, int max)
  9. clampMono(int value)