Class SerializableExpression

java.lang.Object
com.singularsys.jep.walkers.PostfixTreeWalker
com.singularsys.jep.walkers.SerializableExpression
All Implemented Interfaces:
Externalizable, Serializable

public class SerializableExpression extends PostfixTreeWalker implements Externalizable
A serializable representation of an expression. To serialize an expression use
 ObjectOutputStream oos = ...;
 SerializableExpression se = new SerializableExpression(node);
 oos.writeObject(se);
 
To deserialize use
 ObjectInputStream ois = ...;
 SerializableExpression se = (SerializableExpression) ois.readObject();
 Node n = se.toNode(jep);
 
Since Jep 4.0 this class will serialize any Hooks added to the nodes (see Node.HookKey). Expressions serialized in older versions of Jep can still be read by the Jep 4.0 version of this class. Expressions serialized by this version can be read by older version, provide no hooks are set. The HookRemover class can be used to remove any hooks.
See Also:
  • Constructor Details

    • SerializableExpression

      public SerializableExpression(Node node) throws JepException
      Construct a SerializableExpression from a given node
      Parameters:
      node - root node of the expression to serialize
      Throws:
      JepException
    • SerializableExpression

      public SerializableExpression()
      Constructor used by the serializable mechanism. Not for normal use.
  • Method Details