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) |
getLHS
protected 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)
IPatternMatcher
test
in interface java.util.function.Predicate<IExpr>
test
in class IPatternMatcher
true
if the expr
matches the
pattern-matchings left-hand-side expression.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class IPatternMatcher
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public IExpr eval(IExpr leftHandSide)
eval
in class IPatternMatcher
leftHandSide
- 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)
IPatternMatcher
getPatterns
in class IPatternMatcher
resultList
- a list instancepatternExpr
- the expression which contains the pattern objectspublic IExpr getRHS()
getRHS
in class IPatternMatcher
F.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.Object
public boolean isRuleWithoutPatterns()
IPatternMatcher
isRuleWithoutPatterns
in class IPatternMatcher
true
, 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()
IPatternMatcher
getPriority
in class IPatternMatcher
public IAST getAsAST()
public java.lang.String toString()
toString
in class java.lang.Object
public void writeExternal(java.io.ObjectOutput objectOutput) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput objectInput) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException