Package com.saxonica.ee.trans
Class Precondition.StringHashPrecondition
- java.lang.Object
- 
- com.saxonica.ee.trans.Precondition
- 
- com.saxonica.ee.trans.Precondition.StringHashPrecondition
 
 
- 
- Enclosing class:
- Precondition
 
 public static class Precondition.StringHashPrecondition extends Precondition 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.It is used in two situations: (a) for a predicate pattern in the form *[EXP = 'constant'] where the constant hash code is the hash code of the collation key of the constant string, and the characteristic is the set of hash codes corresponding to the collation keys of the strings selected by evaluating EXP. (b) for a predicate pattern in the form *[contains(EXP, ' constant ')], typically encountered in DITA stylesheets, where the constant hash code is the hash code of the collation key of the token being matched (the constant with whitespace trimmed), and the characteristic is the set of hash codes corresponding to the collation keys of the tokens found by evaluating EXP and splitting on whitespace boundaries. 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.saxonica.ee.trans.PreconditionPrecondition.BooleanPrecondition, Precondition.NumericComparisonPrecondition, Precondition.StringHashPrecondition
 
- 
 - 
Constructor SummaryConstructors Constructor Description StringHashPrecondition(Characteristic<IntSet> characteristic, AtomicMatchKey required, StringCollator collator)Create a StringHashPrecondition
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()booleantestPrecondition(PreconditionMatcher matcher)Compute the value of the precondition for a given item.java.lang.StringtoString()- 
Methods inherited from class com.saxonica.ee.trans.PreconditionisSatisfied, setSlotNumber
 
- 
 
- 
- 
- 
Constructor Detail- 
StringHashPreconditionpublic StringHashPrecondition(Characteristic<IntSet> characteristic, AtomicMatchKey required, StringCollator collator) Create a StringHashPrecondition- Parameters:
- characteristic- the characteristic that is tested by this precondition. This must evaluate to a set of hashcodes for permitted string values. The precondition is satisfied if the set of hash codes obtained as the value of the characteristic includes the hash code of the required key value. For example, given- match=*[author='Kay'], the characteristic will be the set of hash codes of the values of 'author' children of the context item; the precondition is satisfied if this includes the hash code of the string 'Kay' under the specified collation.
- required- the required key value, whose hash code must match one of the values in the IntSet value of the characteristic
- collator- the collation to be used for comparison
 
 
- 
 - 
Method Detail- 
testPreconditionpublic boolean testPrecondition(PreconditionMatcher matcher) throws XPathException Description copied from class:PreconditionCompute 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:
- testPreconditionin 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
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-