Java Integer Clip clipInt(int value, int min, int max)

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

Description

clip Int

License

Open Source License

Declaration

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

Method Source Code

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

public class Main {
    public static int clipInt(int value, int min, int max) {
        if (value > max)
            value = max;/*from  w w  w. j a  v  a 2  s .  c o m*/
        if (value < min)
            value = min;
        return value;
    }

    public static int clipInt(int value, int max) {
        if (value > max)
            value = max;
        if (value < 0)
            value = 0;
        return value;
    }
}

Related

  1. clip(int x)
  2. clip(int[][][] data, int startX, int startY, int stopX, int stopY)
  3. clipColor(final int compIn, final boolean allowRGB555)
  4. clipHistogram(final int[] hist, final int[] clippedHist, final int limit)
  5. clipInt(int value, int max)
  6. clipPeerIdFromCurrentThreadName()
  7. clipPlus128(int v)
  8. clipRange(int value, int lowLimit, int highLimit)
  9. clipSigned(int v)