forked from fanruan/finekit
Kalven
5 years ago
17 changed files with 196 additions and 21 deletions
@ -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); |
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
|
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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 { |
||||
} |
@ -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 { |
||||
} |
@ -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 { |
||||
} |
@ -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 { |
||||
} |
@ -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 { |
||||
} |
@ -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 { |
||||
} |
@ -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 { |
||||
} |
@ -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 { |
||||
} |
@ -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 { |
||||
} |
@ -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(); |
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
} |
@ -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(),""); |
||||
} |
||||
} |
Loading…
Reference in new issue