List of utility methods to do Integer Clip
int | clipInt(int value, int min, int max) clip Int if (value > max) value = max; if (value < min) value = min; return value; |
String | clipPeerIdFromCurrentThreadName() 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 ""; |
int | clipPlus128(int v) Clamp, then convert signed number back to pixel value. return (int) (clipSigned(v) + 128); |
int | clipRange(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;
|
int | clipSigned(int v) clip Signed return (int) (v < -128 ? -128 : (v > 127 ? 127 : v)); |