Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Field Summary

Fields inherited from class net.sf.saxon.expr.UnaryExpression
`operand`

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`

Method Summary
`Expression` | `copy()` Copy an expression.
`Item` | `evaluateItem(XPathContext context)` Evaluate the expression
`String` | `getExpressionName()` Get a name identifying the kind of expression, in terms meaningful to a user.
`static Expression` | `makeFirstItemExpression(Expression base)` Static factory method

Methods inherited from class net.sf.saxon.expr.SingleItemFilter
`computeCardinality, optimize, promote`

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`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Method Detail

### 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2004-2011 Saxonica Limited. All rights reserved.