net.sf.saxon.expr

Class IsLastExpression

public final class IsLastExpression extends Expression

A position() eq last() expression, generated by the optimizer.
Constructor Summary
IsLastExpression(boolean condition)
Construct a condition that tests position() eq last() (if condition is true) or position() ne last() (if condition is false).
Method Summary
intcomputeCardinality()
Determine the static cardinality
intcomputeSpecialProperties()
Determine the special properties of this expression
Expressioncopy()
Copy an expression.
ItemevaluateItem(XPathContext c)
voidexplain(ExpressionPresenter destination)
Diagnostic print of expression structure.
booleangetCondition()
Get the condition we are testing for
intgetIntrinsicDependencies()
Get the dependencies of this expression on the context
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the expression
Expressionoptimize(ExpressionVisitor visitor, ItemType contextItemType)
ExpressiontypeCheck(ExpressionVisitor visitor, ItemType contextItemType)

Constructor Detail

IsLastExpression

public IsLastExpression(boolean condition)
Construct a condition that tests position() eq last() (if condition is true) or position() ne last() (if condition is false).

Parameters: condition true if we are testing "equals", false for "not equals".

Method Detail

computeCardinality

public int computeCardinality()
Determine the static cardinality

computeSpecialProperties

public int computeSpecialProperties()
Determine the special properties of this expression

Returns: NON_CREATIVE.

copy

public Expression copy()
Copy an expression. This makes a deep copy.

Returns: the copy of the original expression

evaluateItem

public Item evaluateItem(XPathContext c)

explain

public void explain(ExpressionPresenter destination)
Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.

getCondition

public boolean getCondition()
Get the condition we are testing for

Returns: true if we are testing "equals", false for "not equals".

getIntrinsicDependencies

public int getIntrinsicDependencies()
Get the dependencies of this expression on the context

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the expression

Parameters: th the type hierarchy cache

Returns: Type.BOOLEAN

optimize

public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType)

typeCheck

public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType)