public abstract class Minimax extends CollatingFunctionFixed
| Modifier and Type | Class and Description |
|---|---|
static class |
Minimax.Max
Concrete subclass to define the fn:max() function
|
static class |
Minimax.Min
Concrete subclass to define the fn:min() function
|
| Constructor and Description |
|---|
Minimax() |
| Modifier and Type | Method and Description |
|---|---|
ZeroOrOne<AtomicValue> |
call(XPathContext context,
Sequence[] arguments)
Evaluate the function
|
void |
exportAttributes(ExpressionPresenter out)
Export any context attributes held within the SystemFunction object.
|
PlainType |
getArgumentType() |
AtomicComparer |
getAtomicComparer(XPathContext context)
During evaluation, get the pre-allocated atomic comparer if available, or allocate a new one otherwise
|
int |
getCardinality(Expression[] arguments)
Determine the cardinality of the function.
|
AtomicComparer |
getComparer() |
java.lang.String |
getCompilerName()
Get the (local) name of a class that can be used to generate bytecode for this
system function
|
ItemType |
getResultItemType(Expression[] args)
Get the return type, given knowledge of the actual arguments
|
java.lang.String |
getStreamerName()
Get a name that identifies the class that can be used to evaluate this function
in streaming mode, that is, supplying one item or event at a time as it is
delivered by the parser.
|
void |
importAttributes(java.util.Properties attributes)
Import any attributes found in the export file, that is, any attributes output using
the exportAttributes method
|
boolean |
isIgnoreNaN()
Test whether NaN values are to be ignored
|
abstract boolean |
isMaxFunction()
Method to be implemented in subclasses to indicate whether the function implements
fn:min() or fn:max()
|
Expression |
makeOptimizedFunctionCall(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo,
Expression... arguments)
Allow the function to create an optimized call based on the values of the actual arguments
|
static AtomicValue |
minimax(SequenceIterator iter,
boolean isMaxFunction,
AtomicComparer atomicComparer,
boolean ignoreNaN,
XPathContext context)
Static method to evaluate the minimum or maximum of a sequence
|
void |
setIgnoreNaN(boolean ignore)
Indicate whether NaN values should be ignored.
|
void |
supplyTypeInformation(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType,
Expression[] arguments)
Static analysis: preallocate a comparer if possible
|
copy, getPreAllocatedAtomicComparer, getStringCollator, isSubstringMatchingFunction, preAllocateComparer, setCollationName, setRetainedStaticContextdependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, fixArguments, getArity, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, resultIfEmpty, setArity, setDetails, typeCheckCalleratomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheckgetLength, head, isStreamed, itemAt, iterate, reduce, subsequenceclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLength, head, itemAt, reduce, subsequencepublic abstract boolean isMaxFunction()
public void setIgnoreNaN(boolean ignore)
ignore - true if NaN values are to be ignored when computing the min or max.public boolean isIgnoreNaN()
public AtomicComparer getComparer()
public PlainType getArgumentType()
public ItemType getResultItemType(Expression[] args)
SystemFunctiongetResultItemType in class SystemFunctionargs - the actual arguments suppliedpublic void supplyTypeInformation(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType, Expression[] arguments) throws XPathException
supplyTypeInformation in class SystemFunctionvisitor - an expression visitor, providing access to the static context and configurationcontextItemType - information about whether the context item is set, and what its type isarguments - the expressions appearing as arguments in the function callXPathExceptionpublic int getCardinality(Expression[] arguments)
getCardinality in class SystemFunctionarguments - the actual arguments suppliedpublic Expression makeOptimizedFunctionCall(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression... arguments) throws XPathException
SystemFunctionmakeOptimizedFunctionCall in class SystemFunctionvisitor - the expression visitorcontextInfo - information about the context itemarguments - the supplied arguments to the function call. Note: modifying the contents
of this array should not be attempted, it is likely to have no effect.XPathException - if an error is detectedpublic AtomicComparer getAtomicComparer(XPathContext context)
CollatingFunctionFixedgetAtomicComparer in class CollatingFunctionFixedcontext - the dynamic evaluation contextpublic static AtomicValue minimax(SequenceIterator iter, boolean isMaxFunction, AtomicComparer atomicComparer, boolean ignoreNaN, XPathContext context) throws XPathException
iter - Iterator over the input sequenceisMaxFunction - true for the max() function, false for min()atomicComparer - an AtomicComparer used to compare valuesignoreNaN - true if NaN values are to be ignoredcontext - dynamic evaluation contextXPathException - typically if non-comparable values are found in the sequencepublic ZeroOrOne<AtomicValue> call(XPathContext context, Sequence[] arguments) throws XPathException
context - the dynamic evaluation contextarguments - the values of the arguments, supplied as SequencesXPathException - if a dynamic error occurs during the evaluation of the expressionpublic void exportAttributes(ExpressionPresenter out)
SystemFunctionexportAttributes in class CollatingFunctionFixedout - the export destinationpublic void importAttributes(java.util.Properties attributes)
throws XPathException
SystemFunctionimportAttributes in class CollatingFunctionFixedattributes - the attributes, as a properties objectXPathExceptionpublic java.lang.String getCompilerName()
SystemFunctiongetCompilerName in class SystemFunctionpublic java.lang.String getStreamerName()
SystemFunctiongetStreamerName in class SystemFunctionStreamerMap. In non-streaming Saxon editions
(HE and PE) the method always returns null.Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.