/** * User constants handling. * * @param pos the token position */ private void USER_CONSTANT(int pos) { Constant constant = constantsList.get( tokensList.get(pos).tokenId ); setToNumber(pos, constant.getConstantValue()); } /**
@Override protected void testScenario() { Constant c = new Constant("c", 5); for (int i = 0; i <= super.iterNum; i++) { if (mXparser.isCurrentCalculationCancelled()) break; c = new Constant("c=5"); } c.getConstantValue(); } }
@Override protected void testScenario() { Constant c = new Constant("c", 5); for (int i = 0; i <= super.iterNum; i++) { if (mXparser.isCurrentCalculationCancelled()) break; c = new Constant("c", 5); } c.getConstantValue(); } }
Function n1_geq_2 = new Function("n1_geq_2", "if( z1(k) > 2, k, n1_geq_2(k+1) )", "k"); n1_geq_2.addDefinitions(z1); mXparser.consolePrint(c1.getConstantName() + " = " + c1.getConstantValue() + " ; " + z1.getArgumentName() + " = " + z1.getArgumentExpressionString() + " ; " + n1_geq_2.getFunctionName() + " = " + n1_geq_2.getFunctionExpressionString() + " ; " + expStr + " ...... "); exp[testId] = new Expression(expStr); exp[testId].addDefinitions(n1_geq_2); Function n2_geq_2 = new Function("n2_geq_2", "if( z2(k) > 2, k, n2_geq_2(k+1) )", "k"); n2_geq_2.addDefinitions(z2); mXparser.consolePrint(c2.getConstantName() + " = " + c2.getConstantValue() + " ; " + z2.getFunctionName() + " = " + z2.getFunctionExpressionString() + " ; " + n2_geq_2.getFunctionName() + " = " + n2_geq_2.getFunctionExpressionString() + " ; " + expStr + " ...... "); exp[testId] = new Expression(expStr); exp[testId].addDefinitions(n2_geq_2);