Class AbstractRewrite

java.lang.Object
com.singularsys.extensions.rewrite.AbstractRewrite
All Implemented Interfaces:
RewriteRuleI, JepComponent, Serializable
Direct Known Subclasses:
AbstractVectorMatrixRule, BinaryToNaryRule, CollectPowers, ExpandBrackets, ExpandPower, NaryToBinaryRule, UnchainingRewriteRule

public abstract class AbstractRewrite extends Object implements RewriteRuleI
Basic implementation for a RewriteRule. Subclasses can have access to NodeFactory,OperatorSet,TreeUtils and XJep objects.
Author:
Rich Morris Created on 01-Oct-2004
See Also:
  • Field Details

    • nf

      protected NodeFactory nf
      A NodeFactory used for construction nodes.
    • opSet

      protected OperatorTableI opSet
      An OperatorSet used for finding operators.
    • tu

      protected TreeUtils tu
      TreeUtils for testing types of nodes.
    • jep

      protected Jep jep
      A reference to main XJep object.
    • dcv

      protected DeepCopyVisitor dcv
      A DeepCopyVisitor for copying nodes.
  • Constructor Details

    • AbstractRewrite

      public AbstractRewrite()
  • Method Details

    • init

      public void init(Jep jep)
      Description copied from interface: JepComponent
      Initialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.
      Specified by:
      init in interface JepComponent
      Parameters:
      jep - the current Jep instance
    • getLightWeightInstance

      public JepComponent getLightWeightInstance()
      Description copied from interface: JepComponent
      Gets a light-weight instance suitable for using in multiple threads.
      Specified by:
      getLightWeightInstance in interface JepComponent
      Returns:
      either a new instance, null or 'this'.
    • toString

      public String toString()
      Descriptions for rewrite rules are specified in the properties file with key <class name>.description.
      Overrides:
      toString in class Object