List of utility methods to do Integer Mod
int | mod_diff(int x, int y, int R) modiff int dl = 0; int dr = 0; if (y > x) { dl = y - x; dr = x + R - y; } else { dl = x - y; dr = y + R - x; ... |
int | modByPowerOfTwo(int value, int mod) mod By Power Of Two return value & mod - 1;
|
int | modCeil(int x, int mod) Rounds x up to a lowest number that is greater or equal to x and is divisible by mod .
return x + (mod - x % mod) % mod;
|
StringBuilder | mode(final StringBuilder buffer, final int mode) Sets the text formatting mode. buffer.append("\u001B[").append(mode).append('m'); return buffer; |
int | ModEuclidean(int D, int d) Mod Euclidean int r = D % d; if (r < 0) { if (d > 0) { r = r + d; } else { r = r - d; return r; |
int | modifyAlpha(int color, int alpha) Set the alpha component of color to be alpha . return (color & 0x00ffffff) | (alpha << 24);
|
String | modifyBase32AtIndex(final String s, final int index) Changes a single character in the specified base 32 string. final char[] chars = s.toCharArray(); final char currentChar = chars[index]; char newChar = (char) (currentChar + 1); switch (currentChar) { case 'Z': case '7': newChar = 'A'; chars[index] = newChar; return new String(chars); |
String | modifyDummyString(String dummyString, int beginTag, int endTag) modify Dummy String String dummyStringInterval = createDummyString('*', endTag - beginTag); return new String(dummyString.substring(0, beginTag) + dummyStringInterval + dummyString.substring(endTag, dummyString.length())); |
boolean | modifyPublicPortCheckRange(String modifiedVal, int dashCnt) modify Public Port Check Range Boolean isPortValid = true; try { if (dashCnt == 1) { String[] range = modifiedVal.split("-"); int rngStart = Integer.parseInt(range[0]); int rngEnd = Integer.parseInt(range[1]); if (!(rngStart >= RANGE_MIN && rngStart <= RANGE_MAX && rngEnd >= RANGE_MIN && rngEnd <= RANGE_MAX)) { ... |
String | modifyString(char firstCharacter, String srcString, int indexOfSubstring) modify String return (indexOfSubstring < srcString.length()) ? firstCharacter + srcString.substring(indexOfSubstring)
: String.valueOf(firstCharacter);
|