Java Utililty Methods Integer Align

List of utility methods to do Integer Align

Description

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

Method

intalign(int size, int alignment)
align
return ((size / alignment) + 1) * alignment;
intalign(int size, int space, int weight)
Return the coordinate where something of size 'size' starts in a space of size 'space', with 'weight' as the alignment.
if (weight == ALIGN_LEFT) {
    return 0;
} else if (weight == ALIGN_CENTER) {
    return (space - size) / 2;
} else if (weight == ALIGN_CENTER_OR_TOP) {
    return size <= space ? (space - size) / 2 : 0;
} else  {
    return space - size;
...
intalign(int value, int alignment)
Returns the given (address) value, adjusted to have the given alignment.
return (((value) + (alignment) - 1) & ~((alignment) - 1));