forked from fanruan/finekit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
989 B
36 lines
989 B
package com.fanruan.api.cal; |
|
|
|
import com.fr.base.ParameterHelper; |
|
import com.fr.base.ParameterMapNameSpace; |
|
import com.fr.stable.ParameterProvider; |
|
import com.fr.stable.script.NameSpace; |
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import java.util.Map; |
|
|
|
/** |
|
* @author richie |
|
* @version 10.0 |
|
* Created by richie on 2019-08-16 |
|
* 参数相关的工具类 |
|
*/ |
|
public class ParameterKit { |
|
|
|
/** |
|
* 分析公式中所携带的参数 |
|
* @param text 公式内容 |
|
* @return 参数数组 |
|
*/ |
|
public static @NotNull ParameterProvider[] analyze4ParametersFromFormula(String text) { |
|
return ParameterHelper.analyze4ParametersFromFormula(text); |
|
} |
|
|
|
/** |
|
* 创建一个用于计算的参数对名字空间 |
|
* @param map 参数键值对 |
|
* @return 名字空间,用于传递给算子做计算 |
|
*/ |
|
public static @NotNull NameSpace createParameterMapNameSpace(Map<String, Object> map) { |
|
return ParameterMapNameSpace.create(map); |
|
} |
|
}
|
|
|