public class TailExpression extends UnaryExpression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
Constructor and Description |
---|
TailExpression(Expression base,
int start)
Construct a TailExpression, representing a filter expression of the form
$base[position() >= $start]
|
Modifier and Type | Method and Description |
---|---|
int |
computeCardinality()
Determine the static cardinality.
|
Expression |
copy()
Copy an expression.
|
boolean |
equals(Object other)
Compare two expressions to see if they are equal
|
void |
export(ExpressionPresenter destination)
Diagnostic print of expression structure.
|
ExpressionCompiler |
getExpressionCompiler()
Return the compiler of the TailExpression expression
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
ItemType |
getItemType()
Determine the data type of the expression, if possible.
|
protected OperandRole |
getOperandRole()
Get the usage (in terms of streamability analysis) of the single operand
|
int |
getStart()
Get the start offset
|
StreamingAdjunct |
getStreamingAdjunct()
Get a class that supports streamed evaluation of this expression
|
int |
hashCode()
get HashCode for comparing two expressions.
|
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform optimisation of an expression and its subexpressions.
|
String |
toShortString()
Produce a short string identifying the expression for use in error messages
|
String |
toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form.
|
computeSpecialProperties, displayOperator, getBaseExpression, getOperand, operands, setBaseExpression, typeCheck
addToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExpressionName, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, optimizeForType, process, promote, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toStreamingPattern, typeCheckChildren, typeError, unordered
public TailExpression(Expression base, int start)
base
- the expression to be filteredstart
- the position (1-based) of the first item to be includedpublic Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
UnaryExpression
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
optimize
in class UnaryExpression
visitor
- an expression visitorcontextInfo
- the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
XPathException
- if an error is discovered during this phase
(typically a type error)public Expression copy()
copy
in class Expression
public int getImplementationMethod()
getImplementationMethod
in class Expression
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public ItemType getItemType()
UnaryExpression
getItemType
in class UnaryExpression
public int computeCardinality()
UnaryExpression
computeCardinality
in class UnaryExpression
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
protected OperandRole getOperandRole()
UnaryExpression
getOperandRole
in class UnaryExpression
public int getStart()
public boolean equals(Object other)
equals
in class UnaryExpression
other
- the other expressionpublic int hashCode()
UnaryExpression
hashCode
in class UnaryExpression
public StreamingAdjunct getStreamingAdjunct()
getStreamingAdjunct
in class Expression
public SequenceIterator iterate(XPathContext context) throws XPathException
Expression
iterate
in class Expression
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic ExpressionCompiler getExpressionCompiler()
getExpressionCompiler
in class Expression
public void export(ExpressionPresenter destination)
export
in class UnaryExpression
destination
- the expression presenter used to display the structurepublic String toString()
The toString() method for an expression attempts to give a representation of the expression in an XPath-like form.
For subclasses of Expression that represent XPath expressions, the result should always be a string that parses as an XPath 3.0 expression.
toString
in class UnaryExpression
public String toShortString()
toShortString
in class UnaryExpression
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.