Class OverloadResolver

java.lang.Object
com.singularsys.jep.walkers.GenericDoNothingVisitor<Void>
com.singularsys.jep.misc.overloadedfunctions.OverloadResolver
All Implemented Interfaces:
GenericVisitor<Node,Void,ParseException>, JepComponent, Serializable

public class OverloadResolver extends GenericDoNothingVisitor<Void>
Resolves OverloadedOperator, OverloadedFunctionByStructure and AlternateFunctions setting the operator or PostfixMathCommand of the node based on a test of the node.

    UnaryFunction uf = new ArcTangent();
    BinaryFunction bf =new ArcTangent2();
    AlternateFunctions af = new AlternateFunctions(uf, bf);
    jep.addFunction("atan",af);
    jep.reinitializeComponents();
    OverloadResolver or = new OverloadResolver();
    Node node = jep.parse("atan(1)");
    or.visit(node);
    assertSame(uf,node.getPFMC()); // The single argument function is selected.
 

This visitor modifies the nodes in place.

See Also: