Java Integer Clamp clampTo_0_255(int i)

Here you can find the source of clampTo_0_255(int i)

Description

clamp T_

License

Open Source License

Declaration

public static int clampTo_0_255(int i) 

Method Source Code

//package com.java2s;

public class Main {
    public static int clampTo_0_255(int i) {
        return i > 255 ? 255 : (i < 0 ? 0 : i);
    }//from  w w w.  j av a 2s .  c  o m
}

Related

  1. clampMono(int value)
  2. clampNonNegative(int i, int a, int b)
  3. clampPower(int num)
  4. clampRGB(int val)
  5. clampString(String string, int limit)
  6. clampToByte(int c)
  7. clampToByteSize(int value)
  8. clampToShort(int x)
  9. clampUShortNegative(int in)