Package com.saxonica.ee.trans
Class AncestorCharacteristic
- java.lang.Object
-
- com.saxonica.ee.trans.Characteristic<java.lang.Boolean>
-
- com.saxonica.ee.trans.AncestorCharacteristic
-
public class AncestorCharacteristic extends Characteristic<java.lang.Boolean>
Given an expression, this characteristic returns a boolean indicating whether or not the context item has a parent (or ancestor, respectively) that matches a given pattern
-
-
Constructor Summary
Constructors Constructor Description AncestorCharacteristic(Pattern pattern, boolean isParent)Define an AncestorCharacteristic
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Test whether this characteristic is the same as another characteristic.java.lang.Booleanevaluate(XPathContext context)Evaluate the characteristic as applied to the context iteminthashCode()java.lang.StringtoString()-
Methods inherited from class com.saxonica.ee.trans.Characteristic
getSlotNumber, setSlotNumber
-
-
-
-
Constructor Detail
-
AncestorCharacteristic
public AncestorCharacteristic(Pattern pattern, boolean isParent)
Define an AncestorCharacteristic- Parameters:
pattern- the pattern that an ancestor/parent must satisfy if the the characteristic is to have the value trueisParent- true if the pattern must match the immediate parent; false if the pattern must match some ancestor
-
-
Method Detail
-
evaluate
public java.lang.Boolean evaluate(XPathContext context) throws XPathException
Evaluate the characteristic as applied to the context item- Specified by:
evaluatein classCharacteristic<java.lang.Boolean>- Parameters:
context- the dynamic evaluation context; the context item is the item being matched- Returns:
- true if there is an ancestor/parent satisfying the characteristic pattern
- Throws:
XPathException- if pattern matching fails with a dynamic error
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Test whether this characteristic is the same as another characteristic.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to be compared- Returns:
- true if the two characteristics are equivalent
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-