org.matheclipse.core.patternmatching
Class PatternMatcherAndEvaluator
- java.lang.Object
-
- org.matheclipse.core.patternmatching.IPatternMatcher
-
- org.matheclipse.core.patternmatching.PatternMatcher
-
- org.matheclipse.core.patternmatching.PatternMatcherAndEvaluator
-
public class PatternMatcherAndEvaluator extends PatternMatcher implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.matheclipse.core.patternmatching.PatternMatcher
PatternMatcher.OrderlessMatcher
-
-
Constructor Summary
Constructors Constructor and Description PatternMatcherAndEvaluator(ISymbol setSymbol, IExpr leftHandSide, IExpr rightHandSide)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancheckRHSCondition(EvalEngine engine)Check if the condition for the right-hand-sidesModule[] or Condition[]expressions evaluates totrue.java.lang.Objectclone()booleanequals(java.lang.Object obj)Indicates whether another object is equal to this predicate.IExpreval(IExpr lhsEvalExpr)Match the (left-hand-side) pattern with the given expression.IExprgetRHS()Get the "right-hand-side" of a pattern-matching rule.ISymbolgetSetSymbol()inthashCode()-
Methods inherited from class org.matheclipse.core.patternmatching.PatternMatcher
apply, checkCondition, equivalent, evalLeftHandSide, evalLeftHandSide, getCondition, getPatterns, isRuleWithoutPatterns, setCondition
-
Methods inherited from class org.matheclipse.core.patternmatching.IPatternMatcher
getLHS
-
-
-
-
Constructor Detail
-
PatternMatcherAndEvaluator
public PatternMatcherAndEvaluator(ISymbol setSymbol, IExpr leftHandSide, IExpr rightHandSide)
- Parameters:
setSymbol- the symbol which defines this pattern-matching rule (i.e. Set, SetDelayed,...)leftHandSide- could contain pattern expressions for "pattern-matching"rightHandSide- the result which should be evaluated if the "pattern-matching" succeeds
-
-
Method Detail
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classPatternMatcher- Throws:
java.lang.CloneNotSupportedException
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:PredicateIndicates whether another object is equal to this predicate.Most implementations will have no reason to override the behavior of
Object.equals(java.lang.Object). However, an implementation may also choose to returntruewheneverobjectis aPredicatethat it considers interchangeable with this one. "Interchangeable" typically means thatthis.apply(t) == that.apply(t)for alltof typeT). Note that afalseresult from this method does not imply that the predicates are known not to be interchangeable.- Specified by:
equalsin interfacePredicate<IExpr>- Overrides:
equalsin classPatternMatcher
-
hashCode
public int hashCode()
- Overrides:
hashCodein classPatternMatcher
-
checkRHSCondition
public boolean checkRHSCondition(EvalEngine engine)
Check if the condition for the right-hand-sidesModule[] or Condition[]expressions evaluates totrue.- Overrides:
checkRHSConditionin classPatternMatcher- Returns:
trueif the right-hand-sides condition is fulfilled.- See Also:
checkRHSCondition(EvalEngine)
-
eval
public IExpr eval(IExpr lhsEvalExpr)
Match the (left-hand-side) pattern with the given expression. If true evaluate the right-hand-side for the determined values of the patterns- Overrides:
evalin classPatternMatcher- Parameters:
ee-evalExpr-- Returns:
-
getRHS
public IExpr getRHS()
Description copied from class:IPatternMatcherGet the "right-hand-side" of a pattern-matching rule.- Overrides:
getRHSin classIPatternMatcher- Returns:
nullif no right-hand-side is defined for the pattern matcher
-
getSetSymbol
public ISymbol getSetSymbol()
-
-
DMelt 3.0 © DataMelt by jWork.ORG