net.sf.saxon.expr
Class FirstItemExpression
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.UnaryExpression
net.sf.saxon.expr.SingleItemFilter
net.sf.saxon.expr.FirstItemExpression
- All Implemented Interfaces:
- Serializable, SourceLocator, LocationProvider, SaxonLocator, InstructionInfo, Locator
public final class FirstItemExpression
- extends SingleItemFilter
A FirstItemExpression returns the first item in the sequence returned by a given
base expression
- See Also:
- Serialized Form
Fields inherited from class net.sf.saxon.expr.Expression |
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, PUSH_SELECTION, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, WATCH_METHOD |
Methods inherited from class net.sf.saxon.expr.UnaryExpression |
computeSpecialProperties, displayOperator, equals, explain, getBaseExpression, getItemType, hashCode, iterateSubExpressions, replaceSubExpression, simplify, 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, getImplementationMethod, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeError |
makeFirstItemExpression
public static Expression makeFirstItemExpression(Expression base)
- Static factory method
- Parameters:
base
- A sequence expression denoting sequence whose first item is to be returned
- Returns:
- the FirstItemExpression, or an equivalent
copy
public Expression copy()
- Copy an expression. This makes a deep copy.
- Specified by:
copy
in class Expression
- Returns:
- the copy of the original expression
evaluateItem
public Item evaluateItem(XPathContext context)
throws XPathException
- Evaluate the expression
- Overrides:
evaluateItem
in 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
getExpressionName
public String getExpressionName()
- Description copied from class:
Expression
- Get a name identifying the kind of expression, in terms meaningful to a user.
- Overrides:
getExpressionName
in class Expression
- Returns:
- a name identifying the kind of expression, in terms meaningful to a user.
The name will always be in the form of a lexical XML QName, and should match the name used
in explain() output displaying the expression.
Copyright (c) 2004-2011 Saxonica Limited. All rights reserved.