net.sf.saxon.expr
Class LastItemExpression

java.lang.Object
  extended by net.sf.saxon.expr.Expression
      extended by net.sf.saxon.expr.UnaryExpression
          extended by net.sf.saxon.expr.SingleItemFilter
              extended by net.sf.saxon.expr.LastItemExpression
All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, InstructionInfo, Locator

public final class LastItemExpression
extends SingleItemFilter

A LastItemExpression returns the last item in the sequence returned by a given base expression. The evaluation strategy is to read the input sequence with a one-item lookahead.

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
 
Constructor Summary
LastItemExpression(Expression base)
          Constructor
 
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.
 
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
 

Constructor Detail

LastItemExpression

public LastItemExpression(Expression base)
Constructor

Parameters:
base - A sequence expression denoting sequence whose first item is to be returned
Method Detail

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.