|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.singularsys.jep.walkers.PostfixTreeWalker com.singularsys.jep.walkers.SerializableExpression
public class SerializableExpression
A serializable representation of an expression. To serialize an expression use
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);
Nested Class Summary | |
---|---|
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 Summary | |
---|---|
SerializableExpression()
Constructor used by the serializable mechanism. |
|
SerializableExpression(Node node)
Construct a SerializableExpression from a given node |
Method Summary | |
---|---|
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. |
Methods inherited from class com.singularsys.jep.walkers.PostfixTreeWalker |
---|
supressExaminingChildren, walk, walkSubEquations |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SerializableExpression(Node node) throws JepException
node
- root node of the expression to serialize
JepException
public SerializableExpression()
Method Detail |
---|
public final Node toNode(Jep j) throws JepException
j
- Jep instance specifying the context
JepException
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |