public class PatternMatcherEquals extends IPatternMatcher implements java.io.Externalizable
equals() method.| Modifier and Type | Field and Description |
|---|---|
protected IExpr |
fRightHandSide
Contains the "pattern-matching" expression
|
fLhsPatternExpr| Constructor and Description |
|---|
PatternMatcherEquals()
Public constructor for serialization.
|
PatternMatcherEquals(ISymbol.RuleType setSymbol,
IExpr leftHandSide,
IExpr rightHandSide) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
int |
compareTo(IPatternMatcher o) |
boolean |
equals(java.lang.Object obj) |
IExpr |
eval(IExpr leftHandSide)
Match the given left-hand-side and return an evaluated expression
|
IAST |
getAsAST() |
void |
getPatterns(java.util.List<IExpr> resultList,
IExpr patternExpr)
Returns the matched pattern in the order they appear in the pattern
expression.
|
int |
getPriority()
Get the priority of this pattern-matcher.
|
IExpr |
getRHS()
Get the "right-hand-side" of a pattern-matching rule.
|
ISymbol |
getSetSymbol()
Return
Set or SetDelayed symbol. |
int |
hashCode() |
boolean |
isRuleWithoutPatterns()
Check if the pattern-matchings left-hand-side expression contains no
patterns.
|
void |
readExternal(java.io.ObjectInput objectInput) |
void |
setRHS(IExpr rightHandSide) |
boolean |
test(IExpr lhsEvalExpr)
Start pattern matching.
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput objectOutput) |
getLHSprotected IExpr fRightHandSide
public PatternMatcherEquals()
public PatternMatcherEquals(ISymbol.RuleType setSymbol, IExpr leftHandSide, IExpr rightHandSide)
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"
succeedspublic boolean test(IExpr lhsEvalExpr)
IPatternMatchertest in interface java.util.function.Predicate<IExpr>test in class IPatternMatchertrue if the expr matches the
pattern-matchings left-hand-side expression.public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class IPatternMatcherjava.lang.CloneNotSupportedExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic IExpr eval(IExpr leftHandSide)
eval in class IPatternMatcherleftHandSide - left-hand-side expressionF.NIL if the match wasn't successful, the evaluated
expression otherwise.public void getPatterns(java.util.List<IExpr> resultList, IExpr patternExpr)
IPatternMatchergetPatterns in class IPatternMatcherresultList - a list instancepatternExpr - the expression which contains the pattern objectspublic IExpr getRHS()
getRHS in class IPatternMatcherF.NIL if no right-hand-side is defined for the
pattern matcherpublic ISymbol getSetSymbol()
Set or SetDelayed symbol.null if no symbol was definedpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isRuleWithoutPatterns()
IPatternMatcherisRuleWithoutPatterns in class IPatternMatchertrue, if the given expression contains no patternspublic void setRHS(IExpr rightHandSide)
public int compareTo(IPatternMatcher o)
compareTo in interface java.lang.Comparable<IPatternMatcher>public int getPriority()
IPatternMatchergetPriority in class IPatternMatcherpublic IAST getAsAST()
public java.lang.String toString()
toString in class java.lang.Objectpublic void writeExternal(java.io.ObjectOutput objectOutput)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput objectInput)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundException