public class SerializableExpression extends PostfixTreeWalker implements java.io.Externalizable
ObjectOuputStream oos = ...; SerializableExpression se = new SerializableExpression(node); oos.writeObject(se);To deserialize use
ObjectInputStream ois = ...; SerializableExpression se = (SerializableExpression) ois.readObject(); Node n = se.toNode(jep);
Modifier and Type | Class and Description |
---|---|
static class |
SerializableExpression.Constant |
static interface |
SerializableExpression.Element
interface used in internal representation of expression
|
static class |
SerializableExpression.Function |
static class |
SerializableExpression.Operator |
static class |
SerializableExpression.Variable |
Constructor and Description |
---|
SerializableExpression()
Constructor used by the serializable mechanism.
|
SerializableExpression(Node node)
Construct a SerializableExpression from a given node
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<SerializableExpression.Element> |
iterator()
Returns an iterator for the reverse polish representation of the expression.
|
void |
readExternal(java.io.ObjectInput ois) |
Node |
toNode(Jep j)
Convert to a node in a given context.
|
java.lang.String |
toString() |
protected void |
visit(ASTConstant node,
int nchildren,
int depth)
Visit a constant node
|
protected void |
visit(ASTFunNode node,
int nchildren,
int depth)
Visit a function node
|
protected void |
visit(ASTOpNode node,
int nchildren,
int depth)
Visit an operator node
|
protected void |
visit(ASTVarNode node,
int nchildren,
int depth)
Visit a variable node
|
void |
writeExternal(java.io.ObjectOutput out)
Write a serialized version of the node to a stream.
|
supressExaminingChildren, walk, walkSubEquations
public SerializableExpression(Node node) throws JepException
node
- root node of the expression to serializeJepException
public SerializableExpression()
public final Node toNode(Jep j) throws JepException
j
- Jep instance specifying the contextJepException
public final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- the stream to write to.java.io.IOException
public final void readExternal(java.io.ObjectInput ois) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
protected void visit(ASTFunNode node, int nchildren, int depth) throws JepException
PostfixTreeWalker
visit
in class PostfixTreeWalker
node
- the current node being visitednchildren
- number of children of the nodedepth
- depth of tree, root node is depth 1.JepException
protected void visit(ASTOpNode node, int nchildren, int depth) throws JepException
PostfixTreeWalker
visit
in class PostfixTreeWalker
node
- the current node being visitednchildren
- number of children of the nodedepth
- depth of tree, root node is depth 1.JepException
protected void visit(ASTVarNode node, int nchildren, int depth) throws JepException
PostfixTreeWalker
visit
in class PostfixTreeWalker
node
- the current node being visitednchildren
- number of children of the nodedepth
- depth of tree, root node is depth 1.JepException
protected void visit(ASTConstant node, int nchildren, int depth) throws JepException
PostfixTreeWalker
visit
in class PostfixTreeWalker
node
- the current node being visitednchildren
- number of children of the nodedepth
- depth of tree, root node is depth 1.JepException
public java.util.Iterator<SerializableExpression.Element> iterator()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 Singular Systems http://www.singularsys.com/jep