From 7a6824f448b448773db0a2381d214ef6a7c653b0 Mon Sep 17 00:00:00 2001 From: Kalven Date: Sat, 31 Aug 2019 12:53:55 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-1117=20=E5=8F=91=E7=8E=B0=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E9=81=97=E6=BC=8F=E7=9A=84=E5=9C=B0=E6=96=B9=EF=BC=8C?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/design/util/FunctionDefNAD.java | 15 +++++++++++++ .../api/design/util/FunctionManagerKit.java | 18 ++++++++++++++++ .../api/design/util/NameAndFunctionList.java | 17 +++++++++++++++ .../util/NameAndTypeAndFunctionList.java | 15 +++++++++++++ .../com/fanruan/api/function/AVERAGE.java | 10 +++++++++ .../java/com/fanruan/api/function/CHAR.java | 10 +++++++++ .../java/com/fanruan/api/function/COUNT.java | 10 +++++++++ .../java/com/fanruan/api/function/DATE.java | 10 +++++++++ .../java/com/fanruan/api/function/MAX.java | 10 +++++++++ .../java/com/fanruan/api/function/MIN.java | 10 +++++++++ .../java/com/fanruan/api/function/RANGE.java | 10 +++++++++ .../java/com/fanruan/api/function/SUM.java | 10 +++++++++ .../java/com/fanruan/api/function/TIME.java | 10 +++++++++ .../fanruan/api/macro/OperatingSystemKit.java | 18 ++++++++++++++++ .../fanruan/api/macro/ProductConstants.java | 5 +++++ .../api/plugin/ExtraClassManagerKit.java | 18 ++++++++++++++++ .../api/base/ParameterHelperKitTest.java | 21 ------------------- 17 files changed, 196 insertions(+), 21 deletions(-) create mode 100644 src/main/java/com/fanruan/api/design/util/FunctionDefNAD.java create mode 100644 src/main/java/com/fanruan/api/design/util/FunctionManagerKit.java create mode 100644 src/main/java/com/fanruan/api/design/util/NameAndFunctionList.java create mode 100644 src/main/java/com/fanruan/api/design/util/NameAndTypeAndFunctionList.java create mode 100644 src/main/java/com/fanruan/api/function/AVERAGE.java create mode 100644 src/main/java/com/fanruan/api/function/CHAR.java create mode 100644 src/main/java/com/fanruan/api/function/COUNT.java create mode 100644 src/main/java/com/fanruan/api/function/DATE.java create mode 100644 src/main/java/com/fanruan/api/function/MAX.java create mode 100644 src/main/java/com/fanruan/api/function/MIN.java create mode 100644 src/main/java/com/fanruan/api/function/RANGE.java create mode 100644 src/main/java/com/fanruan/api/function/SUM.java create mode 100644 src/main/java/com/fanruan/api/function/TIME.java create mode 100644 src/main/java/com/fanruan/api/macro/OperatingSystemKit.java create mode 100644 src/main/java/com/fanruan/api/plugin/ExtraClassManagerKit.java delete mode 100644 src/test/java/com/fanruan/api/base/ParameterHelperKitTest.java diff --git a/src/main/java/com/fanruan/api/design/util/FunctionDefNAD.java b/src/main/java/com/fanruan/api/design/util/FunctionDefNAD.java new file mode 100644 index 0000000..fdf1608 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/util/FunctionDefNAD.java @@ -0,0 +1,15 @@ +package com.fanruan.api.design.util; + +import com.fr.stable.script.FunctionDef; + +/** + * 函数名和描述 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class FunctionDefNAD extends com.fr.design.formula.FunctionDefNAD { + public FunctionDefNAD(FunctionDef functionDef) { + super(functionDef); + } +} diff --git a/src/main/java/com/fanruan/api/design/util/FunctionManagerKit.java b/src/main/java/com/fanruan/api/design/util/FunctionManagerKit.java new file mode 100644 index 0000000..72552d4 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/util/FunctionManagerKit.java @@ -0,0 +1,18 @@ +package com.fanruan.api.design.util; + +/** + * 函数管理器 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class FunctionManagerKit { + /** + * 得到函数管理器实例 + * @return 函数管理器 + */ + public static com.fr.file.FunctionManager getInstance() { + return com.fr.file.FunctionManager.getInstance(); + } + +} diff --git a/src/main/java/com/fanruan/api/design/util/NameAndFunctionList.java b/src/main/java/com/fanruan/api/design/util/NameAndFunctionList.java new file mode 100644 index 0000000..99d9089 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/util/NameAndFunctionList.java @@ -0,0 +1,17 @@ +package com.fanruan.api.design.util; + +import com.fr.stable.script.Function; + +import java.util.Arrays; + +/** + * 名称对应的函数列表 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class NameAndFunctionList extends com.fr.design.formula.NameAndFunctionList { + public NameAndFunctionList(String name, Function[] fns) { + super(name, fns); + } +} diff --git a/src/main/java/com/fanruan/api/design/util/NameAndTypeAndFunctionList.java b/src/main/java/com/fanruan/api/design/util/NameAndTypeAndFunctionList.java new file mode 100644 index 0000000..300d800 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/util/NameAndTypeAndFunctionList.java @@ -0,0 +1,15 @@ +package com.fanruan.api.design.util; + +import com.fr.stable.script.Function; + +/** + * 名字和类型对应的函数列表 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class NameAndTypeAndFunctionList extends com.fr.design.formula.NameAndTypeAndFunctionList { + public NameAndTypeAndFunctionList(String name, Function.Type type) { + super(name, type); + } +} diff --git a/src/main/java/com/fanruan/api/function/AVERAGE.java b/src/main/java/com/fanruan/api/function/AVERAGE.java new file mode 100644 index 0000000..837d4ee --- /dev/null +++ b/src/main/java/com/fanruan/api/function/AVERAGE.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,求平均值 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class AVERAGE extends com.fr.function.AVERAGE { +} diff --git a/src/main/java/com/fanruan/api/function/CHAR.java b/src/main/java/com/fanruan/api/function/CHAR.java new file mode 100644 index 0000000..796f550 --- /dev/null +++ b/src/main/java/com/fanruan/api/function/CHAR.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,求ASCII码对应的字符 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class CHAR extends com.fr.function.CHAR { +} diff --git a/src/main/java/com/fanruan/api/function/COUNT.java b/src/main/java/com/fanruan/api/function/COUNT.java new file mode 100644 index 0000000..2ad9646 --- /dev/null +++ b/src/main/java/com/fanruan/api/function/COUNT.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,计算区域内所含项的个数 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class COUNT extends com.fr.function.COUNT { +} diff --git a/src/main/java/com/fanruan/api/function/DATE.java b/src/main/java/com/fanruan/api/function/DATE.java new file mode 100644 index 0000000..a4b22c3 --- /dev/null +++ b/src/main/java/com/fanruan/api/function/DATE.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,获取一个表示某一特定日期的系列数。 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class DATE extends com.fr.function.DATE { +} diff --git a/src/main/java/com/fanruan/api/function/MAX.java b/src/main/java/com/fanruan/api/function/MAX.java new file mode 100644 index 0000000..536a1ed --- /dev/null +++ b/src/main/java/com/fanruan/api/function/MAX.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,求最大值 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class MAX extends com.fr.function.MAX { +} diff --git a/src/main/java/com/fanruan/api/function/MIN.java b/src/main/java/com/fanruan/api/function/MIN.java new file mode 100644 index 0000000..c3ee021 --- /dev/null +++ b/src/main/java/com/fanruan/api/function/MIN.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,求最小值 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class MIN extends com.fr.function.MIN { +} diff --git a/src/main/java/com/fanruan/api/function/RANGE.java b/src/main/java/com/fanruan/api/function/RANGE.java new file mode 100644 index 0000000..4d4733f --- /dev/null +++ b/src/main/java/com/fanruan/api/function/RANGE.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,取范围内满足条件的数据序列 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class RANGE extends com.fr.function.RANGE { +} diff --git a/src/main/java/com/fanruan/api/function/SUM.java b/src/main/java/com/fanruan/api/function/SUM.java new file mode 100644 index 0000000..13eb4f7 --- /dev/null +++ b/src/main/java/com/fanruan/api/function/SUM.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,求和 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class SUM extends com.fr.function.SUM { +} diff --git a/src/main/java/com/fanruan/api/function/TIME.java b/src/main/java/com/fanruan/api/function/TIME.java new file mode 100644 index 0000000..6c12000 --- /dev/null +++ b/src/main/java/com/fanruan/api/function/TIME.java @@ -0,0 +1,10 @@ +package com.fanruan.api.function; + +/** + * 基本函数,求代表指定时间的小数 + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class TIME extends com.fr.function.TIME { +} diff --git a/src/main/java/com/fanruan/api/macro/OperatingSystemKit.java b/src/main/java/com/fanruan/api/macro/OperatingSystemKit.java new file mode 100644 index 0000000..134b69e --- /dev/null +++ b/src/main/java/com/fanruan/api/macro/OperatingSystemKit.java @@ -0,0 +1,18 @@ +package com.fanruan.api.macro; + +import com.fr.stable.OperatingSystem; + +/** + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class OperatingSystemKit { + /** + * 判断是否为windows + * @return 判断结果 + */ + public static boolean isWindows() { + return OperatingSystem.isWindows(); + } +} diff --git a/src/main/java/com/fanruan/api/macro/ProductConstants.java b/src/main/java/com/fanruan/api/macro/ProductConstants.java index 1febf81..ed1637a 100644 --- a/src/main/java/com/fanruan/api/macro/ProductConstants.java +++ b/src/main/java/com/fanruan/api/macro/ProductConstants.java @@ -11,4 +11,9 @@ public class ProductConstants { * 详细的产品名字 */ public static final String PRODUCT_NAME = com.fr.stable.ProductConstants.PRODUCT_NAME; + + /** + * 大的版本号 + */ + public static final String MAIN_VERSION = com.fr.stable.ProductConstants.MAIN_VERSION; } diff --git a/src/main/java/com/fanruan/api/plugin/ExtraClassManagerKit.java b/src/main/java/com/fanruan/api/plugin/ExtraClassManagerKit.java new file mode 100644 index 0000000..90561da --- /dev/null +++ b/src/main/java/com/fanruan/api/plugin/ExtraClassManagerKit.java @@ -0,0 +1,18 @@ +package com.fanruan.api.plugin; + +import com.fr.plugin.ExtraClassManager; + +/** + * @author Kalven + * @version 10.0 + * Created by Kalven on 2019/8/31 + */ +public class ExtraClassManagerKit { + /** + * 获取ExtraClassManager实例 + * @return ExtraClassManager实例 + */ + public static ExtraClassManager getInstance() { + return ExtraClassManager.getInstance(); + } +} diff --git a/src/test/java/com/fanruan/api/base/ParameterHelperKitTest.java b/src/test/java/com/fanruan/api/base/ParameterHelperKitTest.java deleted file mode 100644 index 3be5b3d..0000000 --- a/src/test/java/com/fanruan/api/base/ParameterHelperKitTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fanruan.api.base; - -import com.fr.stable.ParameterProvider; -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * @author Kalven - * @version 10.0 - * Created by Kalven on 2019/8/31 - */ -public class ParameterHelperKitTest { - - @Test - public void analyze4Parameters() { - ParameterProvider p[] = ParameterHelperKit.analyze4Parameters("var a1 = '${A1}';\n" + - "return \"A1的值\" + (a1 > 10 ? \"大于10\" : \"小于等于10\");",false); - assertEquals(p[0].getValue(),""); - } -} \ No newline at end of file