Modifier and Type | Field and Description |
---|---|
public static final int |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public static long | Returns: the value aligned to the next boundary.to be aligned up. value, final int to be used, must be a power of 2. alignment)Align a value to the next multiple up of alignment. |
public static boolean | Returns: true if the value is a power of 2 otherwise false.to be tested to see if it is a power of two. value)
|
public static int | Returns: the next positive power of 2, this value if it is a power of 2. Negative values are mapped to 1.from which next positive power of two will be found. value)
|
MAX_POW2 | back to summary |
---|---|
public static final int MAX_POW2 |
Pow2 | back to summary |
---|---|
public Pow2() |
align | back to summary |
---|---|
public static long align(final long value, final int alignment) Align a value to the next multiple up of alignment. If the value equals an alignment multiple then it is returned unchanged.
|
isPowerOfTwo | back to summary |
---|---|
public static boolean isPowerOfTwo(final int value)
|
roundToPowerOfTwo | back to summary |
---|---|
public static int roundToPowerOfTwo(final int value)
|