org.matheclipse.core.patternmatching
Class HashedPatternRules
- java.lang.Object
-
- org.matheclipse.core.patternmatching.HashedPatternRules
-
public class HashedPatternRules extends java.lang.ObjectData structure forHashedOrderlessMatcher. To set up a rule like
Sin[x]^2+Cos[x]^2 -> 1
use the method:
setUpHashRule("Sin[x_]^2", "Cos[x_]^2", "1")
-
-
Constructor Summary
Constructors Constructor and Description HashedPatternRules(IExpr lhsPattern1, IExpr lhsPattern2, IExpr rhsResult, boolean defaultHashCode)HashedPatternRules(IExpr lhsPattern1, IExpr lhsPattern2, IExpr rhsResult, IExpr condition, boolean defaultHashCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)IExprgetCondition()Get the Condition for this rule.intgetHash1()Get the hash value for the first LHS expression.intgetHash2()Get the hash value for the second LHS expression.IExprgetRHS()DownRulesDatagetRulesData()Get (or create) the rule{<first-left-hand-side>, <second-left-hand-side>}:=<right-hand-side>inthashCode()booleanisPattern2()
-
-
-
Constructor Detail
-
HashedPatternRules
public HashedPatternRules(IExpr lhsPattern1, IExpr lhsPattern2, IExpr rhsResult, boolean defaultHashCode)
- Parameters:
lhsPattern1- first left-hand-side patternlhsPattern2- second left-hand-side patternrhsResult- the right-hand-side resultdefaultHashCode-
-
HashedPatternRules
public HashedPatternRules(IExpr lhsPattern1, IExpr lhsPattern2, IExpr rhsResult, IExpr condition, boolean defaultHashCode)
- Parameters:
lhsPattern1- first left-hand-side patternlhsPattern2- second left-hand-side patternrhsResult- the right-hand-side resultcondition- a condition testdefaultHashCode- TODO
-
-
Method Detail
-
getRHS
public IExpr getRHS()
- Returns:
- the right-hand-side result
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getCondition
public IExpr getCondition()
Get the Condition for this rule.- Returns:
- may return
null.
-
getHash1
public int getHash1()
Get the hash value for the first LHS expression.- Returns:
- the hash1
-
getHash2
public int getHash2()
Get the hash value for the second LHS expression.- Returns:
- the hash2
-
isPattern2
public boolean isPattern2()
-
getRulesData
public DownRulesData getRulesData()
Get (or create) the rule{<first-left-hand-side>, <second-left-hand-side>}:=<right-hand-side>- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG