net.sf.saxon.expr

Class VennExpression

public class VennExpression extends BinaryExpression

An expression representing a nodeset that is a union, difference, or intersection of two other NodeSets
Constructor Summary
VennExpression(Expression p1, int op, Expression p2)
Constructor
Method Summary
intcomputeCardinality()
Determine the static cardinality of the expression
intcomputeSpecialProperties()
Get the static properties of this expression (other than its type).
booleaneffectiveBooleanValue(XPathContext context)
Get the effective boolean value.
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the items returned by this expression
inthashCode()
Is this expression the same as another expression?
SequenceIteratoriterate(XPathContext c)
Iterate over the value of the expression.
Expressionsimplify(StaticContext env)
Simplify the expression
ExpressiontypeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression

Constructor Detail

VennExpression

public VennExpression(Expression p1, int op, Expression p2)
Constructor

Parameters: p1 the left-hand operand op the operator (union, intersection, or difference) p2 the right-hand operand

Method Detail

computeCardinality

public final int computeCardinality()
Determine the static cardinality of the expression

computeSpecialProperties

public int computeSpecialProperties()
Get the static properties of this expression (other than its type). The result is bit-signficant. These properties are used for optimizations. In general, if property bit is set, it is true, but if it is unset, the value is unknown.

effectiveBooleanValue

public boolean effectiveBooleanValue(XPathContext context)
Get the effective boolean value. In the case of a union expression, this is reduced to an OR expression, for efficiency

getItemType

public final ItemType getItemType(TypeHierarchy th)
Determine the data type of the items returned by this expression

Parameters: th

Returns: the data type

hashCode

public int hashCode()
Is this expression the same as another expression?

iterate

public SequenceIterator iterate(XPathContext c)
Iterate over the value of the expression. The result will always be sorted in document order, with duplicates eliminated

Parameters: c The context for evaluation

Returns: a SequenceIterator representing the union of the two operands

simplify

public Expression simplify(StaticContext env)
Simplify the expression

typeCheck

public Expression typeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression