Package net.sf.saxon.functions
Class CollatingFunctionFixed
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.CollatingFunctionFixed
- All Implemented Interfaces:
Callable,StatefulSystemFunction,FunctionItem,GroundedValue,Item,Sequence
- Direct Known Subclasses:
AllDifferent,AllEqual,CollationKeyFn,Compare,Contains,ContainsToken,DeepEqual,DistinctValues,DuplicateValues,EndsWith,IndexOf,Minimax,StartsWith,SubstringAfter,SubstringBefore
public abstract class CollatingFunctionFixed
extends SystemFunction
implements StatefulSystemFunction
Abstract superclass for functions that take an optional collation argument, in which the
collation is not present as an explicit argument, either because it was defaulted in the
original function call, or because it has been bound during static analysis.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Make a copy of this SystemFunction.voidExport any context attributes held within the SystemFunction object.getAtomicComparer(XPathContext context) During evaluation, get the pre-allocated atomic comparer if available, or allocate a new one otherwiseGet the pre-allocated atomic comparer, if availableGet the collation if known statically, as a StringCollator objectvoidimportAttributes(Properties attributes) Import any attributes found in the export file, that is, any attributes output using the exportAttributes methodbooleanAsk whether this function needs a collation that can handle substring matchingprotected voidpreAllocateComparer(AtomicType type0, AtomicType type1, StaticContext env) During static analysis, if types are known and the collation is known, pre-allocate a comparer for comparing atomic values.voidsetCollationName(String collationName) voidsetRetainedStaticContext(RetainedStaticContext retainedStaticContext) Set the static context in which the function operates, for use with functions whose result depends on the static contextMethods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, fixArguments, getArity, getCardinality, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, getUniStringArg, hashCode, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, supplyTypeInformation, 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
getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
CollatingFunctionFixed
public CollatingFunctionFixed()
-
-
Method Details
-
isSubstringMatchingFunction
public boolean isSubstringMatchingFunction()Ask whether this function needs a collation that can handle substring matching- Returns:
- true in the case of functions such as contains() and starts-with() where substring matching is required. Returns false by default;
-
getStringCollator
Get the collation if known statically, as a StringCollator object- Returns:
- a StringCollator. Return null if the collation is not known statically.
-
setRetainedStaticContext
Description copied from class:SystemFunctionSet the static context in which the function operates, for use with functions whose result depends on the static context- Overrides:
setRetainedStaticContextin classSystemFunction- Parameters:
retainedStaticContext- the retained static context
-
setCollationName
- Throws:
XPathException
-
preAllocateComparer
During static analysis, if types are known and the collation is known, pre-allocate a comparer for comparing atomic values. Called by some collating functions during type-checking. The comparer that is allocated treats NaN as not equal to NaN.- Parameters:
type0- the type of the first comparandtype1- the type of the second comparandenv- the static context
-
getPreAllocatedAtomicComparer
Get the pre-allocated atomic comparer, if available- Returns:
- the preallocated atomic comparer, or null
-
getAtomicComparer
During evaluation, get the pre-allocated atomic comparer if available, or allocate a new one otherwise- Parameters:
context- the dynamic evaluation context- Returns:
- the pre-allocated comparer if one is available; otherwise, a newly allocated one, using the specified StringCollator for comparing strings
-
exportAttributes
Description copied from class:SystemFunctionExport any context attributes held within the SystemFunction object. The implementation will normally make one or more calls on out.emitAttribute(name, value).- Overrides:
exportAttributesin classSystemFunction- Parameters:
out- the export destination
-
importAttributes
Description copied from class:SystemFunctionImport any attributes found in the export file, that is, any attributes output using the exportAttributes method- Overrides:
importAttributesin classSystemFunction- Parameters:
attributes- the attributes, as a properties object- Throws:
XPathException- if errors are found in the SEF file
-
copy
Make a copy of this SystemFunction. This is required only for system functions such as regex functions that maintain state on behalf of a particular caller.- Specified by:
copyin interfaceStatefulSystemFunction- Returns:
- a copy of the system function able to contain its own copy of the state on behalf of the caller.
-