Package org.scijava.util
Class NumberUtils
- java.lang.Object
-
- org.scijava.util.NumberUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigDecimalasBigDecimal(Number n)static BigIntegerasBigInteger(Number n)static NumberclampToRange(Class<?> type, Number value, Number min, Number max)static NumbergetDefaultValue(Number min, Number max, Class<?> type)static NumbergetMaximumNumber(Class<?> type)static NumbergetMinimumNumber(Class<?> type)static NumbertoNumber(Object value, Class<?> type)Converts the given object to aNumberof the specified type, or null if the types are incompatible.
-
-
-
Method Detail
-
toNumber
public static Number toNumber(Object value, Class<?> type)
Converts the given object to aNumberof the specified type, or null if the types are incompatible.
-
asBigDecimal
public static BigDecimal asBigDecimal(Number n)
-
asBigInteger
public static BigInteger asBigInteger(Number n)
-
-