本文整理汇总了Java中org.nfunk.jep.function.PostfixMathCommandI类的典型用法代码示例。如果您正苦于以下问题:Java PostfixMathCommandI类的具体用法?Java PostfixMathCommandI怎么用?Java PostfixMathCommandI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostfixMathCommandI类属于org.nfunk.jep.function包,在下文中一共展示了PostfixMathCommandI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MacroDiffRules
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
/**
* Create a differention rule for function with 1 argument
*
* @param inName
* name of function
* @param inPfmc
* PostfixMathCommandI for function
* @param rule
* a string represention differation of function wrt "x"
* @throws ParseException
*/
public MacroDiffRules(DJep djep, String inName, PostfixMathCommandI inPfmc, String rule) throws ParseException {
// super(dv);
name = inName;
pfmc = inPfmc;
if (pfmc != null) {
int nParam = pfmc.getNumberOfParameters();
if (nParam != 1)
throw new ParseException("Number of rules must match number of parameters for " + inName + " which is "
+ nParam);
}
XSymbolTable localSymTab = (XSymbolTable) ((XSymbolTable) djep.getSymbolTable()).newInstance(); // new
// SymbolTable();
localSymTab.copyConstants(djep.getSymbolTable());
XJep localJep = djep.newInstance(localSymTab);
Node node = localJep.parse(rule);
rules = new Node[1];
rules[0] = node;
// fixVarNames();
}
示例2: MacroDiffRules
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
/**
* Create a differention rule for function with 1 argument
* @param inName name of function
* @param inPfmc PostfixMathCommandI for function
* @param rule a string represention differation of function wrt "x"
* @throws ParseException
*/
public MacroDiffRules(DJep djep,String inName,PostfixMathCommandI inPfmc,String rule) throws ParseException
{
//super(dv);
name = inName;
pfmc = inPfmc;
if(pfmc!=null)
{
int nParam = pfmc.getNumberOfParameters();
if(nParam != 1)
throw new ParseException("Number of rules must match number of parameters for "+inName+" which is "+nParam);
}
XSymbolTable localSymTab = (XSymbolTable) ((XSymbolTable) djep.getSymbolTable()).newInstance(); //new SymbolTable();
localSymTab.copyConstants(djep.getSymbolTable());
XJep localJep = djep.newInstance(localSymTab);
Node node = localJep.parse(rule);
rules = new Node[1];
rules[0] = node;
//fixVarNames();
}
示例3: addFunctions
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
public static void addFunctions( JEP parser )
{
for ( Entry<String, PostfixMathCommandI> e : ALL_FUNCTIONS.entrySet() )
{
String fname = e.getKey();
PostfixMathCommandI cmd = e.getValue();
parser.addFunction( fname, cmd );
}
}
示例4: visit
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
public Object visit(ASTFunNode node, Object data) throws ParseException {
Node children[] = acceptChildrenAsArray(node, data);
PostfixMathCommandI pfmc = node.getPFMC();
if (pfmc instanceof CommandVisitorI) {
CommandVisitorI com = (CommandVisitorI) pfmc;
return com.process(node, children, xjep);
}
TreeUtils.copyChildrenIfNeeded(node, children);
return node;
}
示例5: Operator
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
/** construct a new operator.
*
* @param name printable name of operator
* @param pfmc postfix math command for opperator
*/
public Operator(String name, PostfixMathCommandI pfmc) {
this();
this.name = name;
this.pfmc = pfmc;
this.symbol = name;
}
示例6: visit
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
public Object visit(ASTFunNode node, Object data) throws ParseException
{
Node children[] = acceptChildrenAsArray(node,data);
PostfixMathCommandI pfmc = node.getPFMC();
if(pfmc instanceof CommandVisitorI )
{
CommandVisitorI com = (CommandVisitorI) pfmc;
return com.process(node,children,xjep);
}
TreeUtils.copyChildrenIfNeeded(node,children);
return node;
}
示例7: Operator
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
/** construct a new operator.
*
* @param name printable name of operator
* @param pfmc postfix math command for opperator
*/
public Operator(String name,PostfixMathCommandI pfmc)
{
this();
this.name = name; this.pfmc = pfmc;
this.symbol = name;
}
示例8: evaluate
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
/**
*
*/
public Object evaluate(PostfixMathCommandI pfmc, Node node) throws ParseException {
// TODO Auto-generated method stub
return super.evaluate(node);
}
示例9: getPfmc
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
/** returns the PostfixMathCommandI for the function. */
public PostfixMathCommandI getPfmc() {
return pfmc;
}
示例10: PassThroughDiffRule
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
public PassThroughDiffRule(String inName, PostfixMathCommandI inPfmc) {
name = inName;
pfmc = inPfmc;
}
示例11: getPFMC
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
public final PostfixMathCommandI getPFMC() {
return pfmc;
}
示例12: setPFMC
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
public final void setPFMC(PostfixMathCommandI pfmc) {
this.pfmc = pfmc;
}
示例13: getPFMC
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
public final PostfixMathCommandI getPFMC() {
return pfmc;
}
示例14: setPFMC
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
public final void setPFMC(PostfixMathCommandI pfmc) {
this.pfmc = pfmc;
}
示例15: put
import org.nfunk.jep.function.PostfixMathCommandI; //导入依赖的package包/类
/** adds the PostfixMathCommandI for the function with name s.
* RJM addition Oct 03
*/
public Object put(String s, PostfixMathCommandI pfmc) {
return map.put(s, pfmc);
}