Java Utililty Methods Integer Clip

List of utility methods to do Integer Clip

Description

The list of methods to do Integer Clip are organized into topic(s).

Method

intclipInt(int value, int min, int max)
clip Int
if (value > max)
    value = max;
if (value < min)
    value = min;
return value;
StringclipPeerIdFromCurrentThreadName()
clip Peer Id From Current Thread Name
String currName = Thread.currentThread().getName();
int ix = currName.lastIndexOf(ID_SEPARATOR_IN_THREADNAME);
if (ix != -1) {
    return currName.substring(ix + 1, currName.length());
return "";
intclipPlus128(int v)
Clamp, then convert signed number back to pixel value.
return (int) (clipSigned(v) + 128);
intclipRange(int value, int lowLimit, int highLimit)
This method clips the given value to the range limited by the given low and high limits.
return (value < lowLimit) ? lowLimit : (value > highLimit) ? highLimit : value;
intclipSigned(int v)
clip Signed
return (int) (v < -128 ? -128 : (v > 127 ? 127 : v));