Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public static int | Returns: the value0 if x == y ;
-1 if x < y ; and
1 if x > y the first x, final int int to comparethe second y)int to compareCompares two |
public static int | Returns:
the first x, long long to compare.the second y)long to compare.Compare two |
public static int | Returns: The next power of 2 or the value itself if it is a power of 2from which to search for next power of 2 value)Fast method of finding the next power of 2 greater than or equal to the supplied value. |
public static boolean | Returns: false if the requested index and length will fit within capacity .
true if this would result in an index out of bounds exception.The starting index. index, int The length which will be utilized (starting from length, int index ).The capacity that capacity)index + length is allowed to be within.Determine if the requested |
public static int | Returns: The next power of 2 or the value itself if it is a power of 2.Special cases for return values are as follows:
from which to search for next power of 2 value)Fast method of finding the next power of 2 greater than or equal to the supplied value. |
MathUtil | back to summary |
---|---|
private MathUtil() |
compare | back to summary |
---|---|
public static int compare(final int x, final int y) Compares two
|
compare | back to summary |
---|---|
public static int compare(long x, long y) Compare two
|
findNextPositivePowerOfTwo | back to summary |
---|---|
public static int findNextPositivePowerOfTwo(final int value) Fast method of finding the next power of 2 greater than or equal to the supplied value. If the value is
|
isOutOfBounds | back to summary |
---|---|
public static boolean isOutOfBounds(int index, int length, int capacity) Determine if the requested
|
safeFindNextPositivePowerOfTwo | back to summary |
---|---|
public static int safeFindNextPositivePowerOfTwo(final int value) Fast method of finding the next power of 2 greater than or equal to the supplied value. This method will do runtime bounds checking and call
|