net.sf.saxon.expr

Class TailExpression

public class TailExpression extends Expression

A TailExpression represents a FilterExpression of the form EXPR[position() > n] Here n is usually 2, but we allow other values
Field Summary
Expressionbase
intstart
Constructor Summary
TailExpression(Expression base, int start)
Construct a TailExpression, representing a filter expression of the form $base[position() >= $start]
Method Summary
intcomputeCardinality()
intcomputeSpecialProperties()
Expressioncopy()
Copy an expression.
booleanequals(Object other)
Compare two expressions to see if they are equal
voidexplain(ExpressionPresenter destination)
Diagnostic print of expression structure.
ExpressiongetBaseExpression()
Get the base expression (of which this expression returns the tail part of the value)
ItemTypegetItemType(TypeHierarchy th)
intgetStart()
Get the start offset
inthashCode()
SequenceIteratoriterate(XPathContext context)
Iterator<Expression>iterateSubExpressions()
Expressionoptimize(ExpressionVisitor visitor, ItemType contextItemType)
Expressionpromote(PromotionOffer offer, Expression parent)
booleanreplaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression
ExpressiontypeCheck(ExpressionVisitor visitor, ItemType contextItemType)

Field Detail

base

Expression base

start

int start

Constructor Detail

TailExpression

public TailExpression(Expression base, int start)
Construct a TailExpression, representing a filter expression of the form $base[position() >= $start]

Parameters: base the expression to be filtered start the position (1-based) of the first item to be included

Method Detail

computeCardinality

public int computeCardinality()

computeSpecialProperties

public int computeSpecialProperties()

copy

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

Returns: the copy of the original expression

equals

public boolean equals(Object other)
Compare two expressions to see if they are equal

Parameters: other the other expression

Returns: true if the expressions are equivalent

explain

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

getBaseExpression

public Expression getBaseExpression()
Get the base expression (of which this expression returns the tail part of the value)

Returns: the base expression

getItemType

public ItemType getItemType(TypeHierarchy th)

getStart

public int getStart()
Get the start offset

Returns: the one-based start offset (returns 2 if all but the first item is being selected)

hashCode

public int hashCode()

iterate

public SequenceIterator iterate(XPathContext context)

iterateSubExpressions

public Iterator<Expression> iterateSubExpressions()

optimize

public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType)

promote

public Expression promote(PromotionOffer offer, Expression parent)

replaceSubExpression

public boolean replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression

Parameters: original the original subexpression replacement the replacement subexpression

Returns: true if the original subexpression is found

typeCheck

public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType)