Package net.sf.saxon.functions
Class PositionAndLast
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.ContextAccessorFunction
net.sf.saxon.functions.PositionAndLast
- All Implemented Interfaces:
Callable,IContextAccessorFunction,IFunctionWithRetainedParameterNames,FunctionItem,GroundedValue,Item,Sequence
- Direct Known Subclasses:
PositionAndLast.Last,PositionAndLast.Position
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbindContext(XPathContext context) Bind a context item to appear as part of the function's closure.call(XPathContext context, Sequence[] arguments) Evaluate the expressionabstract Int64ValueEvaluate in a general contextintGet an estimate of the net cost of evaluating the function, excluding the cost of evaluating its arguments.booleanAsk whether the context item may possibly be undefinedvoidsupplyTypeInformation(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression[] arguments) Method called during static type checking.Methods inherited from class net.sf.saxon.functions.ContextAccessorFunction
dependsOnContextMethods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getOperandRoles, getParameterNames, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, getUniqueIdentifier, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, makeFunctionCall, makeOptimizedFunctionCall, makeTrueFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, toShortString, toString, typeCheckCallerMethods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEqual40, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheckMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.om.FunctionItem
getGenreMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materializeMethods inherited from interface net.sf.saxon.om.Item
getLabel, getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
PositionAndLast
public PositionAndLast()
-
-
Method Details
-
getNetCost
public int getNetCost()Get an estimate of the net cost of evaluating the function, excluding the cost of evaluating its arguments. The result is 0 for very simple functions like position() and exists(), 1 by default, and higher values for particularly expensive functions.- Overrides:
getNetCostin classSystemFunction- Returns:
- the estimated cost
-
bindContext
Bind a context item to appear as part of the function's closure. If this method has been called, the supplied context item will be used in preference to the context item at the point where the function is actually called.- Parameters:
context- the context to which the function applies. Must not be null.
-
supplyTypeInformation
public void supplyTypeInformation(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression[] arguments) throws XPathException Description copied from class:SystemFunctionMethod called during static type checking. This method may be implemented in subclasses so that functions can take advantage of knowledge of the types of the arguments that will be supplied.- Overrides:
supplyTypeInformationin classSystemFunction- Parameters:
visitor- an expression visitor, providing access to the static context and configurationcontextInfo- information about whether the context item is set, and what its type isarguments- the expressions appearing as arguments in the function call- Throws:
XPathException- if an error is detected
-
isContextPossiblyUndefined
public boolean isContextPossiblyUndefined()Ask whether the context item may possibly be undefined- Returns:
- true if it might be undefined
-
evaluateItem
Evaluate in a general context- Throws:
XPathException
-
call
Evaluate the expression- Specified by:
callin interfaceCallable- Overrides:
callin classContextAccessorFunction- Parameters:
context- the dynamic evaluation contextarguments- the values of the arguments, supplied as Sequences- Returns:
- the result of the evaluation, in the form of a Sequence
- Throws:
XPathException- if a dynamic error occurs during the evaluation of the expression
-