Package net.sf.saxon.functions
Class Aggregate
java.lang.Object
net.sf.saxon.expr.ComputedExpression
net.sf.saxon.expr.FunctionCall
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.Aggregate
- All Implemented Interfaces:
Serializable,SourceLocator,Container,Expression,InstructionInfoProvider
This class implements the sum(), avg(), count() functions,
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class net.sf.saxon.functions.SystemFunction
operationFields inherited from class net.sf.saxon.expr.FunctionCall
argumentFields inherited from class net.sf.saxon.expr.ComputedExpression
locationId, staticPropertiesFields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidStatic analysis: prevent sorting of the argumentstatic intcount(SequenceIterator iter) Get the number of items in a sequence identified by a SequenceIteratorevaluateItem(XPathContext context) Evaluate the functionDetermine the item type of the value returned by the functionstatic booleanDetermine whether a given expression is a call to the count() functionMethods inherited from class net.sf.saxon.functions.SystemFunction
addContextDocumentArgument, computeCardinality, computeSpecialProperties, display, getDetails, getErrorCodeForTypeErrors, getRequiredType, main, makeSystemFunction, setDetails, useContextItemAsDefaultMethods inherited from class net.sf.saxon.expr.FunctionCall
checkArgumentCount, getArguments, getDisplayName, getFunctionNameCode, getNumberOfArguments, iterateSubExpressions, optimize, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionNameCode, simplify, simplifyArguments, typeCheckMethods inherited from class net.sf.saxon.expr.ComputedExpression
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, getCardinality, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, iterate, markTailFunctionCalls, process, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation, typeError
-
Field Details
-
SUM
public static final int SUM- See Also:
-
AVG
public static final int AVG- See Also:
-
COUNT
public static final int COUNT- See Also:
-
-
Constructor Details
-
Aggregate
public Aggregate()
-
-
Method Details
-
checkArguments
Static analysis: prevent sorting of the argument- Overrides:
checkArgumentsin classSystemFunction- Throws:
XPathException
-
getItemType
Determine the item type of the value returned by the function- Specified by:
getItemTypein interfaceExpression- Overrides:
getItemTypein classSystemFunction- Parameters:
th-- Returns:
- a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, or Type.ITEM (meaning not known at compile time)
-
evaluateItem
Evaluate the function- Specified by:
evaluateItemin interfaceExpression- Overrides:
evaluateItemin classComputedExpression- Parameters:
context- The context in which the expression is to be evaluated- Returns:
- the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
- Throws:
XPathException- if any dynamic error occurs evaluating the expression
-
count
Get the number of items in a sequence identified by a SequenceIterator- Parameters:
iter- The SequenceIterator. This method moves the current position of the supplied iterator; if this isn't safe, make a copy of the iterator first by calling getAnother(). The supplied iterator must be positioned before the first item (there must have been no call on next()).- Returns:
- the number of items in the underlying sequence
- Throws:
XPathException- if a failure occurs reading the input sequence
-
isCountFunction
Determine whether a given expression is a call to the count() function
-