public final class Ints extends Object
int primitives.
jupiter
org.jupiter.common.util| 限定符和类型 | 字段和说明 |
|---|---|
static int |
MAX_POWER_OF_TWO
The largest power of two that can be represented as an int.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
checkedCast(long value)
Returns the
int value that is equal to value, if possible. |
static int |
findNextPositivePowerOfTwo(int value)
Fast method of finding the next power of 2 greater than or equal to the supplied value.
|
static int |
saturatedCast(long value)
Returns the
int nearest in value to value. |
public static final int MAX_POWER_OF_TWO
public static int checkedCast(long value)
int value that is equal to value, if possible.public static int saturatedCast(long value)
int nearest in value to value.public static int findNextPositivePowerOfTwo(int value)
<= 0 then 1 will be returned.
This method is not suitable for Integer.MIN_VALUE or numbers greater than 2^30.value - from which to search for next power of 2Copyright © 2018. All rights reserved.