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() |
ExpressionCompiler |
getExpressionCompiler()
Return the compiler of the Minimax expression
|
MinimaxAdjunct |
getStreamingAdjunct()
Get a class that supports streamed evaluation of this expression
|
void |
importAttributes(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
|
getPreAllocatedAtomicComparer, getStringCollator, preAllocateComparer, setCollationName, setRetainedStaticContextequals, export, getArity, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, makeCall, makeFunction, makeFunctionCall, resultIfEmpty, setArity, setDetails, typeCheckCalleratomize, deepEquals, effectiveBooleanValue, getStringValue, getStringValueCS, isArray, isMap, optimize, simplify, typeCheckgetLength, head, 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 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(Properties attributes) throws XPathException
SystemFunctionimportAttributes in class CollatingFunctionFixedattributes - the attributes, as a properties objectXPathExceptionpublic ExpressionCompiler getExpressionCompiler()
getExpressionCompiler in class SystemFunctionpublic MinimaxAdjunct getStreamingAdjunct()
getStreamingAdjunct in class SystemFunctionCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.