org.matheclipse.core.patternmatching
Class IPatternMatcher
- java.lang.Object
-
- org.matheclipse.core.patternmatching.IPatternMatcher
-
- Direct Known Subclasses:
- PatternMatcher, PatternMatcherEquals
public abstract class IPatternMatcher extends java.lang.Object implements Predicate<IExpr>, java.lang.Cloneable
Interface for the pattern matcher
-
-
Constructor Summary
Constructors Constructor and Description IPatternMatcher(IExpr lhsPatternExpr)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract booleanapply(IExpr expr)Start pattern matching.java.lang.Objectclone()abstract IExpreval(IExpr expr)Match the given left-hand-side and return an evaluated expressionIExprgetLHS()Get the "left-hand-side" of a pattern-matching rule.abstract voidgetPatterns(java.util.List<IExpr> resultList, IExpr patternExpr)Returns the matched pattern in the order they appear in the pattern expression.IExprgetRHS()Get the "right-hand-side" of a pattern-matching rule.abstract booleanisRuleWithoutPatterns()Check if the pattern-matchings left-hand-side expression contains no patterns.
-
-
-
Constructor Detail
-
IPatternMatcher
public IPatternMatcher(IExpr lhsPatternExpr)
-
-
Method Detail
-
getLHS
public IExpr getLHS()
Get the "left-hand-side" of a pattern-matching rule.- Returns:
-
getRHS
public IExpr getRHS()
Get the "right-hand-side" of a pattern-matching rule.- Returns:
nullif no right-hand-side is defined for the pattern matcher
-
getPatterns
public abstract void getPatterns(java.util.List<IExpr> resultList, IExpr patternExpr)
Returns the matched pattern in the order they appear in the pattern expression.- Parameters:
resultList- a list instancepatternExpr- the expression which contains the pattern objects
-
isRuleWithoutPatterns
public abstract boolean isRuleWithoutPatterns()
Check if the pattern-matchings left-hand-side expression contains no patterns.- Returns:
true, if the given expression contains no patterns
-
apply
public abstract boolean apply(IExpr expr)
Start pattern matching.
-
eval
public abstract IExpr eval(IExpr expr)
Match the given left-hand-side and return an evaluated expression- Parameters:
expr-- Returns:
nullif the match wasn't successful, the evaluated expression otherwise.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-
DMelt 3.0 © DataMelt by jWork.ORG