CustomFunction
de.congrace.exp4j

Class CustomFunction



  • public abstract class CustomFunctionextends Object
    this classed is used to create custom functions for exp4j

    Example
             CustomFunction fooFunc = new CustomFunction("foo") {                public double applyFunction(double value) {                        return value*Math.E;                } }; double varX=12d; Calculable calc = new ExpressionBuilder("foo(x)").withCustomFunction(fooFunc).withVariable("x",varX).build(); assertTrue(calc.calculate() == Math.E * varX); }
    • Method Detail

      • getArgumentCount

        public int getArgumentCount()
      • applyFunction

        public abstract double applyFunction(double... args)

SCaVis 2.2 © jWork.ORG