public abstract class Precondition
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Precondition.BooleanPrecondition
A BooleanPrecondition can in principle test any boolean characteristic
of a pattern.
|
static class |
Precondition.NumericComparisonPrecondition
A numeric comparison precondition is used for patterns containing a predicate that compares some
expression E with a numeric constant.
|
static class |
Precondition.StringHashPrecondition
A StringHashPrecondition compares a characteristic in the form of a set of integer hash codes
against a constant hash code; the precondition is satisfied if the constant hash code is present
in the set.
|
Constructor and Description |
---|
Precondition() |
Modifier and Type | Method and Description |
---|---|
boolean |
isSatisfied(PreconditionMatcher matcher)
Ask whether the precondition is satisfied, making use of caching
|
void |
setSlotNumber(int slotNumber)
Allocate a slot number indicating where in the data maintained by the
PreconditionMatcher
the value of this precondition should be held |
protected abstract boolean |
testPrecondition(PreconditionMatcher matcher)
Compute the value of the precondition for a given item.
|
public void setSlotNumber(int slotNumber)
PreconditionMatcher
the value of this precondition should be heldslotNumber
- the slot number to be used for the value of this preconditionpublic final boolean isSatisfied(PreconditionMatcher matcher) throws XPathException
matcher
- The PreconditionMatcher
holds the values of conditions
that have already been matched, which is therefore used as a cache
of values that do not need to be evaluated repeatedly. In addition
it holds the dynamic evaluation context; the context item is the
item being matched.XPathException
- if evaluation of the precondition fails with a dynamic errorprotected abstract boolean testPrecondition(PreconditionMatcher matcher) throws XPathException
matcher
- the PreconditionMatcher: holds the dynamic context for evaluation.XPathException
- if evaluation of the precondition fails with a dynamic errorCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.