public class CaseInsensitiveFunctionTable extends FunctionTable
Note that this table does not include any functions by default. You will need to add any functions you need.
jep = new Jep(); jep.setComponent(new CaseInsensitiveFunctionTable()); jep.addFunction("if",new If()); jep.parse("if(1>0,2,3)"); System.out.println(jep.evaluate());
If you want to include all the functions in an existing table you can use
FunctionTable oldFT = jep.getFunctionTable(); jep.setComponent(new CaseInsensitiveFunctionTable()); for(Entry<String, PostfixMathCommandI> ent:oldFT.entrySet()) { jep.addFunction(ent.getKey(), ent.getValue()); }
table
Constructor and Description |
---|
CaseInsensitiveFunctionTable() |
Modifier and Type | Method and Description |
---|---|
PostfixMathCommandI |
addFunction(java.lang.String name,
PostfixMathCommandI pfmc) |
boolean |
containsKey(java.lang.String key) |
PostfixMathCommandI |
getFunction(java.lang.String name) |
FunctionTable |
shallowCopy()
Returns a new shallow copy of this function table.
|
clear, containsValue, entrySet, getLightWeightInstance, init, isEmpty, keySet, remove, size, toString, values
public PostfixMathCommandI getFunction(java.lang.String name)
getFunction
in class FunctionTable
public PostfixMathCommandI addFunction(java.lang.String name, PostfixMathCommandI pfmc)
addFunction
in class FunctionTable
public boolean containsKey(java.lang.String key)
containsKey
in class FunctionTable
public FunctionTable shallowCopy()
FunctionTable
shallowCopy
in class FunctionTable
Copyright © 2018 Singular Systems http://www.singularsys.com/jep