net.sf.saxon.functions

Class CollatingFunction

public abstract class CollatingFunction extends SystemFunction

Abstract superclass for all functions that take an optional collation argument
Field Summary
protected XPathContextconversionContext
Method Summary
voidcheckArguments(StaticContext env)
protected AtomicComparergetAtomicComparer(int arg, XPathContext context)
Get a AtomicComparer that can be used to compare values
protected ComparatorgetCollator(int arg, XPathContext context)
Get a collator suitable for comparing strings.
voidpreEvaluateCollation(StaticContext env)
Pre-evaluate the collation argument if its value is known statically

Field Detail

conversionContext

protected XPathContext conversionContext

Method Detail

checkArguments

public void checkArguments(StaticContext env)

getAtomicComparer

protected AtomicComparer getAtomicComparer(int arg, XPathContext context)
Get a AtomicComparer that can be used to compare values

Parameters: arg the position of the argument (starting at 0) containing the collation name. If this argument was not supplied, the default collation is used context The dynamic evaluation context.

getCollator

protected Comparator getCollator(int arg, XPathContext context)
Get a collator suitable for comparing strings. Returns the collator specified in the given function argument if present, otherwise returns the default collator.

Parameters: arg The argument position (counting from zero) that holds the collation URI if present context The dynamic context

Returns: a Comparator, which will either be a java.text.Collator, or a CodepointCollator

preEvaluateCollation

public void preEvaluateCollation(StaticContext env)
Pre-evaluate the collation argument if its value is known statically