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
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 Summary
FieldsModifier and TypeFieldDescriptionprotected DeepCopyVisitorA DeepCopyVisitor for copying nodes.protected JepA reference to main XJep object.protected NodeFactoryA NodeFactory used for construction nodes.protected OperatorTableIAn OperatorSet used for finding operators.protected TreeUtilsTreeUtils for testing types of nodes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a light-weight instance suitable for using in multiple threads.voidInitialize the component.toString()Descriptions for rewrite rules are specified in the properties file with key<class name>.description.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.singularsys.extensions.rewrite.RewriteRuleI
apply, test
-
Field Details
-
nf
A NodeFactory used for construction nodes. -
opSet
An OperatorSet used for finding operators. -
tu
TreeUtils for testing types of nodes. -
jep
A reference to main XJep object. -
dcv
A DeepCopyVisitor for copying nodes.
-
-
Constructor Details
-
AbstractRewrite
public AbstractRewrite()
-
-
Method Details
-
init
Description copied from interface:JepComponentInitialize 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:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either a new instance, null or 'this'.
-
toString
Descriptions for rewrite rules are specified in the properties file with key<class name>.description.
-