net.sf.saxon.expr

Class LocalVariableReference

Implemented Interfaces:
BindingReference, EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator

public class LocalVariableReference
extends VariableReference

Variable reference: a reference to a local variable. This subclass of VariableReference bypasses the Binding object to get the value directly from the relevant slot in the local stackframe.

Field Summary

Fields inherited from class net.sf.saxon.expr.VariableReference

binding, staticType

Fields inherited from class net.sf.saxon.expr.Expression

EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD, locationId, staticProperties

Constructor Summary

LocalVariableReference()
Create a local variable reference.
LocalVariableReference(Binding binding)
Create a LocalVariableReference bound to a given Binding

Method Summary

ValueRepresentation
evaluateVariable(XPathContext c)
Return the value of the variable
int
getSlotNumber()
Get the slot number allocated to this local variable
void
refineVariableReference()
Replace this VariableReference where appropriate by a more efficient implementation.
void
setSlotNumber(int slotNumber)
Set the slot number for this local variable, that is, its position in the local stack frame

Methods inherited from class net.sf.saxon.expr.VariableReference

addToPathMap, computeCardinality, computeSpecialProperties, copy, equals, evaluateItem, evaluateVariable, explain, fixup, getBinding, getDisplayName, getImplementationMethod, getIntrinsicDependencies, getItemType, hashCode, isFiltered, isFlattened, isInLoop, iterate, optimize, process, promote, refineVariableReference, refineVariableType, setFiltered, setFlattened, setStaticType, toString, typeCheck

Methods inherited from class net.sf.saxon.expr.Expression

addToPathMap, adoptChildExpression, checkPermittedContents, computeCardinality, computeDependencies, computeSpecialProperties, computeStaticProperties, copy, display, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, explain, findParentOf, getCardinality, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getItemType, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, iterate, iterateEvents, iterateSubExpressions, markTailFunctionCalls, optimize, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, toString, typeCheck, typeError

Constructor Details

LocalVariableReference

public LocalVariableReference()
Create a local variable reference. The binding and slot number will be supplied later

LocalVariableReference

public LocalVariableReference(Binding binding)
Create a LocalVariableReference bound to a given Binding
Parameters:
binding - the binding (that is, the declaration of this local variable)

Method Details

evaluateVariable

public ValueRepresentation evaluateVariable(XPathContext c)
            throws XPathException
Return the value of the variable
Overrides:
evaluateVariable in interface VariableReference
Parameters:
c - the XPath dynamic context
Returns:
the value of the variable
Throws:
XPathException - if any dynamic error occurs while evaluating the variable

getSlotNumber

public int getSlotNumber()
Get the slot number allocated to this local variable
Returns:
the slot number

refineVariableReference

public void refineVariableReference()
Replace this VariableReference where appropriate by a more efficient implementation.

setSlotNumber

public void setSlotNumber(int slotNumber)
Set the slot number for this local variable, that is, its position in the local stack frame
Parameters:
slotNumber - the slot number to be used