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

Class PatternMatcher

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      class  PatternMatcher.OrderlessMatcher
      Matches an IAST with header attribute Orderless .
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean apply(IExpr leftHandSide)
      Start pattern matching.
      boolean checkCondition()
      Check if the condition for this pattern matcher evaluates to true.
      boolean checkRHSCondition(EvalEngine engine)
      Check if the condition for the right-hand-sides Module[] or Condition[] expressions evaluates to true.
      java.lang.Object clone() 
      boolean equals(java.lang.Object obj)
      Indicates whether another object is equal to this predicate.
      static boolean equivalent(IExpr patternExpr1, IExpr patternExpr2)
      Check if the two left-hand-side pattern expressions are equivalent.
      IExpr eval(IExpr leftHandSide)
      Match the given left-hand-side and return an evaluated expression
      static IExpr evalLeftHandSide(IAST leftHandSide) 
      static IExpr evalLeftHandSide(IAST leftHandSide, EvalEngine engine)
      Transform the ast recursively, according to the attributes Flat, HoldAll, HoldFirst, HoldRest, Orderless for the left-hand-side of a Set[] or SetDelayed[] expression.
      IExpr getCondition()
      Get the additional condition for pattern-matching
      void getPatterns(java.util.List<IExpr> resultList, IExpr pExpr)
      Returns the matched pattern in the order they appear in the pExpr
      int hashCode() 
      boolean isRuleWithoutPatterns()
      Returns true if the given expression contains no patterns
      void setCondition(IExpr condition)
      Sets an additional evaluation-condition for pattern-matching
      • Methods inherited from class java.lang.Object

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

      • PatternMatcher

        public PatternMatcher()
        Needed for serialization
        Parameters:
        patternExpr -
      • PatternMatcher

        public PatternMatcher(IExpr patternExpr)
    • Method Detail

      • checkCondition

        public boolean checkCondition()
        Check if the condition for this pattern matcher evaluates to true.
      • equivalent

        public static boolean equivalent(IExpr patternExpr1,
                                         IExpr patternExpr2)
        Check if the two left-hand-side pattern expressions are equivalent. (i.e. f[x_,y_] is equivalent to f[a_,b_] )
        Parameters:
        patternExpr1 -
        patternExpr2 -
        pm1 -
        pm2 -
        Returns:
      • getPatterns

        public void getPatterns(java.util.List<IExpr> resultList,
                                IExpr pExpr)
        Returns the matched pattern in the order they appear in the pExpr
        Specified by:
        getPatterns in class IPatternMatcher
        Parameters:
        resultList -
        pExpr -
      • isRuleWithoutPatterns

        public final boolean isRuleWithoutPatterns()
        Returns true if the given expression contains no patterns
        Specified by:
        isRuleWithoutPatterns in class IPatternMatcher
        Returns:
      • apply

        public boolean apply(IExpr leftHandSide)
        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.
      • eval

        public IExpr eval(IExpr leftHandSide)
        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.
      • 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
      • hashCode

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

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

        public IExpr getCondition()
        Get the additional condition for pattern-matching
      • setCondition

        public void setCondition(IExpr condition)
        Sets an additional evaluation-condition for pattern-matching
      • evalLeftHandSide

        public static IExpr evalLeftHandSide(IAST leftHandSide,
                                             EvalEngine engine)
        Transform the ast recursively, according to the attributes Flat, HoldAll, HoldFirst, HoldRest, Orderless for the left-hand-side of a Set[] or SetDelayed[] expression. Delegates to EvalEngine#evalSetAttributes()method
        Parameters:
        ast -
        Returns:
        See Also:
        org.matheclipse.core.eval.EvalEngine#evalSetAttributes()
      • evalLeftHandSide

        public static IExpr evalLeftHandSide(IAST leftHandSide)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.