Looly 5 years ago
parent
commit
9ad2848bbd

+ 1 - 1
CHANGELOG.md

@@ -3,7 +3,7 @@
 
 
 -------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------
 
 
-# 5.5.3 (2020-12-04)
+# 5.5.3 (2020-12-05)
 
 
 ### 新特性
 ### 新特性
 * 【core   】     IdcardUtil增加行政区划83(issue#1277@Github)
 * 【core   】     IdcardUtil增加行政区划83(issue#1277@Github)

+ 3 - 55
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java

@@ -1516,7 +1516,7 @@ public class NumberUtil {
 	 */
 	 */
 	public static int processMultiple(int selectNum, int minNum) {
 	public static int processMultiple(int selectNum, int minNum) {
 		int result;
 		int result;
-		result = mathSubnode(selectNum, minNum) / mathNode(selectNum - minNum);
+		result = mathSubNode(selectNum, minNum) / mathNode(selectNum - minNum);
 		return result;
 		return result;
 	}
 	}
 
 
@@ -2493,64 +2493,12 @@ public class NumberUtil {
 		return true;
 		return true;
 	}
 	}
 
 
-	/**
-	 * 检查value是否在[min,max]范围内
-	 *
-	 * @param min 最小值
-	 * @param max 最大值
-	 * @param value 被检查值
-	 * @return 检查结果,范围内将返回true,否则返回false
-	 * @since 5.5.4
-	 */
-	public static boolean isBetween(int min, int max, int value) {
-		return value >= min && value <= max;
-	}
-
-	/**
-	 * 检查value是否在[min,max]范围内
-	 *
-	 * @param min 最小值
-	 * @param max 最大值
-	 * @param value 被检查值
-	 * @return 检查结果,范围内将返回true,否则返回false
-	 * @since 5.5.4
-	 */
-	public static boolean isBetween(long min, long max, long value) {
-		return value >= min && value <= max;
-	}
-
-	/**
-	 * 检查value是否在[min,max]范围内
-	 *
-	 * @param min 最小值
-	 * @param max 最大值
-	 * @param value 被检查值
-	 * @return 检查结果,范围内将返回true,否则返回false
-	 * @since 5.5.4
-	 */
-	public static boolean isBetween(float min, float max, float value) {
-		return value >= min && value <= max;
-	}
-
-	/**
-	 * 检查value是否在[min,max]范围内
-	 *
-	 * @param min 最小值
-	 * @param max 最大值
-	 * @param value 被检查值
-	 * @return 检查结果,范围内将返回true,否则返回false
-	 * @since 5.5.4
-	 */
-	public static boolean isBetween(double min, double max, double value) {
-		return value >= min && value <= max;
-	}
-
 	// ------------------------------------------------------------------------------------------- Private method start
 	// ------------------------------------------------------------------------------------------- Private method start
-	private static int mathSubnode(int selectNum, int minNum) {
+	private static int mathSubNode(int selectNum, int minNum) {
 		if (selectNum == minNum) {
 		if (selectNum == minNum) {
 			return 1;
 			return 1;
 		} else {
 		} else {
-			return selectNum * mathSubnode(selectNum - 1, minNum);
+			return selectNum * mathSubNode(selectNum - 1, minNum);
 		}
 		}
 	}
 	}
 
 

+ 8 - 0
hutool-core/src/test/java/cn/hutool/core/lang/ValidatorTest.java

@@ -187,4 +187,12 @@ public class ValidatorTest {
 		zipCode = Validator.isZipCode("102629");
 		zipCode = Validator.isZipCode("102629");
 		Assert.assertTrue(zipCode);
 		Assert.assertTrue(zipCode);
 	}
 	}
+
+	@Test
+	public void isBetweenTest() {
+		Assert.assertTrue(Validator.isBetween(0, 0, 1));
+		Assert.assertTrue(Validator.isBetween(1L, 0L, 1L));
+		Assert.assertTrue(Validator.isBetween(0.19f, 0.1f, 0.2f));
+		Assert.assertTrue(Validator.isBetween(0.19, 0.1, 0.2));
+	}
 }
 }

+ 0 - 8
hutool-core/src/test/java/cn/hutool/core/util/NumberUtilTest.java

@@ -303,12 +303,4 @@ public class NumberUtilTest {
 		Assert.assertEquals("0", NumberUtil.toStr(NumberUtil.sub(new BigDecimal("9600.0000000000"), new BigDecimal("9600.000000"))));
 		Assert.assertEquals("0", NumberUtil.toStr(NumberUtil.sub(new BigDecimal("9600.0000000000"), new BigDecimal("9600.000000"))));
 		Assert.assertEquals("0", NumberUtil.toStr(new BigDecimal("9600.00000").subtract(new BigDecimal("9600.000000000"))));
 		Assert.assertEquals("0", NumberUtil.toStr(new BigDecimal("9600.00000").subtract(new BigDecimal("9600.000000000"))));
 	}
 	}
-
-	@Test
-	public void isBetweenTest() {
-		Assert.assertTrue(NumberUtil.isBetween(0, 1, 0));
-		Assert.assertTrue(NumberUtil.isBetween(0l, 1l, 1l));
-		Assert.assertTrue(NumberUtil.isBetween(0.1f, 0.2f, 0.19f));
-		Assert.assertTrue(NumberUtil.isBetween(0.1, 0.2, 0.19));
-	}
 }
 }