net.sf.saxon.functions
Class Count
java.lang.Object
   net.sf.saxon.expr.Expression
net.sf.saxon.expr.Expression
       net.sf.saxon.expr.FunctionCall
net.sf.saxon.expr.FunctionCall
           net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.SystemFunction
               net.sf.saxon.functions.Aggregate
net.sf.saxon.functions.Aggregate
                   net.sf.saxon.functions.Count
net.sf.saxon.functions.Count
- All Implemented Interfaces: 
- Serializable, SourceLocator, LocationProvider, SaxonLocator, EvaluableItem, SequenceIterable, InstructionInfo, Locator
- public class Count 
- extends Aggregate
Implementation of the fn:count function
- See Also:
- Serialized Form
 
 
 
 
| Constructor Summary | 
| Count()
 | 
 
 
 
| Methods inherited from class net.sf.saxon.functions.SystemFunction | 
| addContextDocumentArgument, addDocToPathMap, computeCardinality, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, getItemType, getRequiredType, makeSystemFunction, optimize, setDetails, useContextItemAsDefault | 
 
| Methods inherited from class net.sf.saxon.expr.FunctionCall | 
| addExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getExpressionName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheck | 
 
| Methods inherited from class net.sf.saxon.expr.Expression | 
| addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeError | 
 
 
Count
public Count()
getImplementationMethod
public int getImplementationMethod()
- Description copied from class: SystemFunction
- An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
 This method indicates which of these methods is provided directly. The other methods will always be available
 indirectly, using an implementation that relies on one of the other methods.
 
- 
- Overrides:
- getImplementationMethodin class- SystemFunction
 
- 
- Returns:
- the implementation method, for example Expression.ITERATE_METHODorExpression.EVALUATE_METHODorExpression.PROCESS_METHOD
 
evaluateItem
public Item evaluateItem(XPathContext context)
                  throws XPathException
- Evaluate the function
 
- 
- Specified by:
- evaluateItemin interface- EvaluableItem
- Overrides:
- evaluateItemin class- Expression
 
- 
- 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
public static int count(SequenceIterator iter)
                 throws XPathException
- 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
 
Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.