Package com.saxonica.ee.trans

## Class Precondition.NumericComparisonPrecondition

- java.lang.Object
- - com.saxonica.ee.trans.Precondition
  - - com.saxonica.ee.trans.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.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.saxonica.ee.trans.Precondition

      `Precondition.BooleanPrecondition, Precondition.NumericComparisonPrecondition, Precondition.StringHashPrecondition`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NumericComparisonPrecondition​(Characteristic<NumericValue> characteristic, long required)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(java.lang.Object obj)` |
    `int` | `hashCode()` |
    `boolean` | `testPrecondition​(PreconditionMatcher matcher)` | Compute the value of the precondition for a given item.
    `java.lang.String` | `toString()` |

    - ### Methods inherited from class com.saxonica.ee.trans.Precondition

      `isSatisfied, setSlotNumber`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NumericComparisonPrecondition

          public NumericComparisonPrecondition​(Characteristic<NumericValue> characteristic,
                                               long required)

  - ### Method Detail

    - #### testPrecondition

          public 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`