public class Aggregate extends SystemFunction
Modifier and Type | Field and Description |
---|---|
static int |
AVG |
static int |
COUNT |
static int |
SUM |
operation
argument
locationId, staticProperties
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
Constructor and Description |
---|
Aggregate() |
Modifier and Type | Method and Description |
---|---|
void |
checkArguments(StaticContext env)
Static analysis: prevent sorting of the argument
|
static int |
count(SequenceIterator iter)
Get the number of items in a sequence identified by a SequenceIterator
|
Item |
evaluateItem(XPathContext context)
Evaluate the function
|
ItemType |
getItemType(TypeHierarchy th)
Determine the item type of the value returned by the function
|
static boolean |
isCountFunction(Expression exp)
Determine whether a given expression is a call to the count() function
|
addContextDocumentArgument, computeCardinality, computeSpecialProperties, display, getDetails, getErrorCodeForTypeErrors, getRequiredType, main, makeSystemFunction, setDetails, useContextItemAsDefault
checkArgumentCount, getArguments, getDisplayName, getFunctionNameCode, getNumberOfArguments, iterateSubExpressions, optimize, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionNameCode, simplify, simplifyArguments, typeCheck
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
public static final int SUM
public static final int AVG
public static final int COUNT
public void checkArguments(StaticContext env) throws XPathException
checkArguments
in class SystemFunction
XPathException
public ItemType getItemType(TypeHierarchy th)
getItemType
in interface Expression
getItemType
in class SystemFunction
th
- public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface Expression
evaluateItem
in class ComputedExpression
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic static int count(SequenceIterator iter) throws XPathException
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()).XPathException
- if a failure occurs reading the input sequencepublic static boolean isCountFunction(Expression exp)