List of utility methods to do Integer Align
int | align(final int value, final int align) align return (value + align - 1) & ~(align - 1);
|
int | align(final int value, final int alignment) Align a value to the next multiple up of an alignment number. return (value + (alignment - 1)) & ~(alignment - 1);
|
int | align(final int value, final int pow2alignment) Fast alignment operation with power of 2 alignment and value >=0 and value < Integer#MAX_VALUE . In order to be fast is up to the caller to check arguments correctness. return (value + (pow2alignment - 1)) & ~(pow2alignment - 1);
|
int | align(int addr, int align) align if ((addr % align) == 0) { return addr; } else { return ((addr / align) + 1) * align; |
String | align(int cur, int longest) Returns a string with the number of spaces to align two strings. String toret = ""; for (int i = cur; i < longest; i++) { toret = toret.concat(" "); return toret; |
String | align(int i) align String s = String.valueOf(i); if (s.length() == 0) { return "00" + s; if (s.length() == 1) { return "0" + s; return s; ... |
int | align(int min, int number, int max) align return Math.min(max, Math.max(min, number));
|
int | align(int pos, int align) align if ((pos % align) != 0) return pos + (align - (pos % align)); return pos; |
int | align(int size) Align |size| on BindingsHelper#ALIGNMENT . return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
|
int | align(int size, int align) align assert isPowerOf2(align); return (size + align - 1) & ~(align - 1); |