Documentation of 'org.matheclipse.core.patternmatching.PatternMatcherEquals' Java class
PatternMatcherEquals
org.matheclipse.core.patternmatching

Class PatternMatcherEquals

  • All Implemented Interfaces:
    Predicate<IExpr>, java.io.Serializable, java.lang.Cloneable


    public class PatternMatcherEquals
    extends IPatternMatcher
    implements java.io.Serializable
    Matches a given expression by simply comparing the left-hand-side expression of this pattern matcher with the equals() method.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean apply(IExpr lhsEvalExpr)
      Start pattern matching.
      java.lang.Object clone() 
      boolean equals(java.lang.Object obj)
      Indicates whether another object is equal to this predicate.
      IExpr eval(IExpr lhsEvalExpr)
      Match the given left-hand-side and return an evaluated expression
      void getPatterns(java.util.List<IExpr> resultList, IExpr patternExpr)
      Returns the matched pattern in the order they appear in the pattern expression.
      IExpr getRHS()
      Get the "right-hand-side" of a pattern-matching rule.
      ISymbol getSetSymbol() 
      int hashCode() 
      boolean isRuleWithoutPatterns()
      Check if the pattern-matchings left-hand-side expression contains no patterns.
      void setRHS(IExpr rightHandSide) 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PatternMatcherEquals

        public PatternMatcherEquals(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

      • apply

        public boolean apply(IExpr lhsEvalExpr)
        Description copied from class: IPatternMatcher
        Start pattern matching.
        Specified by:
        apply in interface Predicate<IExpr>
        Specified by:
        apply in class IPatternMatcher
        Returns:
        true if the expr matches the pattern-matchings left-hand-side expression.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class IPatternMatcher
        Throws:
        java.lang.CloneNotSupportedException
      • equals

        public boolean equals(java.lang.Object obj)
        Description copied from interface: Predicate
        Indicates 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 return true whenever object is a Predicate that it considers interchangeable with this one. "Interchangeable" typically means that this.apply(t) == that.apply(t) for all t of type T). Note that a false result from this method does not imply that the predicates are known not to be interchangeable.

        Specified by:
        equals in interface Predicate<IExpr>
        Overrides:
        equals in class java.lang.Object
      • eval

        public IExpr eval(IExpr lhsEvalExpr)
        Description copied from class: IPatternMatcher
        Match the given left-hand-side and return an evaluated expression
        Specified by:
        eval in class IPatternMatcher
        Returns:
        null if the match wasn't successful, the evaluated expression otherwise.
      • getPatterns

        public void getPatterns(java.util.List<IExpr> resultList,
                                IExpr patternExpr)
        Description copied from class: IPatternMatcher
        Returns the matched pattern in the order they appear in the pattern expression.
        Specified by:
        getPatterns in class IPatternMatcher
        Parameters:
        resultList - a list instance
        patternExpr - the expression which contains the pattern objects
      • getRHS

        public IExpr getRHS()
        Get the "right-hand-side" of a pattern-matching rule.
        Overrides:
        getRHS in class IPatternMatcher
        Returns:
        null if no right-hand-side is defined for the pattern matcher
      • getSetSymbol

        public ISymbol getSetSymbol()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isRuleWithoutPatterns

        public boolean isRuleWithoutPatterns()
        Description copied from class: IPatternMatcher
        Check if the pattern-matchings left-hand-side expression contains no patterns.
        Specified by:
        isRuleWithoutPatterns in class IPatternMatcher
        Returns:
        true, if the given expression contains no patterns
      • setRHS

        public void setRHS(IExpr rightHandSide)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.