Class Precondition.NumericComparisonPrecondition

  • Enclosing class:
    Precondition

    public static class Precondition.NumericComparisonPrecondition
    extends Precondition
    A numeric comparison precondition is used for patterns containing a predicate that compares some expression E with a numeric constant. The expression E is evaluated as a characteristic, so that in a set of rules with predicates that compare E against different numeric constants, the expression E is only evaluated once.
    • Constructor Detail

      • NumericComparisonPrecondition

        public NumericComparisonPrecondition​(Characteristic characteristic,
                                             long required)
    • Method Detail

      • testPrecondition

        protected boolean testPrecondition​(PreconditionMatcher matcher)
                                    throws XPathException
        Description copied from class: Precondition
        Compute the value of the precondition for a given item. The item in question is the context item in the dynamic context held in the PreconditionMatcher
        Specified by:
        testPrecondition in class Precondition
        Parameters:
        matcher - the PreconditionMatcher: holds the dynamic context for evaluation.
        Returns:
        true if the precondition is satisfied
        Throws:
        XPathException - if evaluation of the precondition fails with a dynamic error
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object