|
35 | 35 | import java.math.BigDecimal; |
36 | 36 | import java.math.BigInteger; |
37 | 37 |
|
| 38 | +import org.scijava.util.Types; |
| 39 | + |
38 | 40 |
|
39 | 41 | /** |
40 | 42 | * Useful methods for working with {@link Number} objects. |
@@ -73,22 +75,22 @@ public static BigInteger asBigInteger(final Number n) { |
73 | 75 | } |
74 | 76 |
|
75 | 77 | public static Number getMinimumNumber(final Class<?> type) { |
76 | | - if (ClassUtils.isByte(type)) return Byte.MIN_VALUE; |
77 | | - if (ClassUtils.isShort(type)) return Short.MIN_VALUE; |
78 | | - if (ClassUtils.isInteger(type)) return Integer.MIN_VALUE; |
79 | | - if (ClassUtils.isLong(type)) return Long.MIN_VALUE; |
80 | | - if (ClassUtils.isFloat(type)) return -Float.MAX_VALUE; |
81 | | - if (ClassUtils.isDouble(type)) return -Double.MAX_VALUE; |
| 78 | + if (Types.isByte(type)) return Byte.MIN_VALUE; |
| 79 | + if (Types.isShort(type)) return Short.MIN_VALUE; |
| 80 | + if (Types.isInteger(type)) return Integer.MIN_VALUE; |
| 81 | + if (Types.isLong(type)) return Long.MIN_VALUE; |
| 82 | + if (Types.isFloat(type)) return -Float.MAX_VALUE; |
| 83 | + if (Types.isDouble(type)) return -Double.MAX_VALUE; |
82 | 84 | return null; |
83 | 85 | } |
84 | 86 |
|
85 | 87 | public static Number getMaximumNumber(final Class<?> type) { |
86 | | - if (ClassUtils.isByte(type)) return Byte.MAX_VALUE; |
87 | | - if (ClassUtils.isShort(type)) return Short.MAX_VALUE; |
88 | | - if (ClassUtils.isInteger(type)) return Integer.MAX_VALUE; |
89 | | - if (ClassUtils.isLong(type)) return Long.MAX_VALUE; |
90 | | - if (ClassUtils.isFloat(type)) return Float.MAX_VALUE; |
91 | | - if (ClassUtils.isDouble(type)) return Double.MAX_VALUE; |
| 88 | + if (Types.isByte(type)) return Byte.MAX_VALUE; |
| 89 | + if (Types.isShort(type)) return Short.MAX_VALUE; |
| 90 | + if (Types.isInteger(type)) return Integer.MAX_VALUE; |
| 91 | + if (Types.isLong(type)) return Long.MAX_VALUE; |
| 92 | + if (Types.isFloat(type)) return Float.MAX_VALUE; |
| 93 | + if (Types.isDouble(type)) return Double.MAX_VALUE; |
92 | 94 | return null; |
93 | 95 | } |
94 | 96 |
|
|
0 commit comments