Package com.singularsys.jep.walkers
Class ImportationVisitor
- java.lang.Object
-
- com.singularsys.jep.walkers.DoNothingVisitor
-
- com.singularsys.jep.walkers.DeepCopyVisitor
-
- com.singularsys.jep.walkers.ImportationVisitor
-
- All Implemented Interfaces:
JepComponent
,ParserVisitor
,java.io.Serializable
public class ImportationVisitor extends DeepCopyVisitor
Imports an expression from one Jep instance into another. This class is quicker than using a SerializableExpression but cannot handle such large equations.Jep sourceJep = ...; Jep destJep = ...; ImportationVisitor iv = new ImportationVisitor(destJep); Node node = sourceJep.parse("x^2-y^2"); Node imported = iv.deepCopy(node);
- Since:
- Jep 3.5
- Author:
- Richard Morris
- See Also:
SerializableExpression
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ImportationVisitor(Jep j)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
visit(ASTFunNode node, java.lang.Object data)
Ensures that functions will be correct for the give Jep instance.java.lang.Object
visit(ASTOpNode node, java.lang.Object data)
Ensures that operators are correct for the given Jep instance.java.lang.Object
visit(ASTVarNode node, java.lang.Object data)
Uses the name of the variable rather than the variable reference to create the node-
Methods inherited from class com.singularsys.jep.walkers.DeepCopyVisitor
deepCopy, visit
-
Methods inherited from class com.singularsys.jep.walkers.DoNothingVisitor
childrenHaveChanged, copyChildrenIfNeeded, getFunctionTable, getLightWeightInstance, getNodeFactory, getOperatorTable, getVariableTable, init, visit, visitChildren, visitNode
-
-
-
-
Constructor Detail
-
ImportationVisitor
public ImportationVisitor(Jep j)
-
-
Method Detail
-
visit
public java.lang.Object visit(ASTVarNode node, java.lang.Object data) throws ParseException
Uses the name of the variable rather than the variable reference to create the node- Specified by:
visit
in interfaceParserVisitor
- Overrides:
visit
in classDeepCopyVisitor
- Throws:
ParseException
-
visit
public java.lang.Object visit(ASTFunNode node, java.lang.Object data) throws JepException
Ensures that functions will be correct for the give Jep instance. Necessary for functions which implementJepComponent
.- Specified by:
visit
in interfaceParserVisitor
- Overrides:
visit
in classDeepCopyVisitor
- Throws:
JepException
- Since:
- 4.0
-
visit
public java.lang.Object visit(ASTOpNode node, java.lang.Object data) throws JepException
Ensures that operators are correct for the given Jep instance. Necessary for functions which implementJepComponent
.- Specified by:
visit
in interfaceParserVisitor
- Overrides:
visit
in classDeepCopyVisitor
- Throws:
JepException
- Since:
- 4.0
-
-