Package net.sf.saxon.expr
Class LocalVariableReference
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.VariableReference
net.sf.saxon.expr.LocalVariableReference
- All Implemented Interfaces:
Serializable
,SourceLocator
,LocationProvider
,SaxonLocator
,BindingReference
,InstructionInfo
,Locator
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.
- See Also:
-
Field Summary
FieldsFields inherited from class net.sf.saxon.expr.VariableReference
binding, constantValue, displayName, staticType
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
ConstructorsConstructorDescriptionCreate a local variable reference.LocalVariableReference
(Binding binding) Create a LocalVariableReference bound to a given Binding -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a clone copy of this VariableReferenceReturn the value of the variableint
Get the slot number allocated to this local variablevoid
setSlotNumber
(int slotNumber) Set the slot number for this local variable, that is, its position in the local stack frameMethods inherited from class net.sf.saxon.expr.VariableReference
addToPathMap, computeCardinality, computeSpecialProperties, equals, evaluateItem, explain, fixup, getBinding, getDisplayName, getImplementationMethod, getIntegerBounds, getIntrinsicDependencies, getItemType, hashCode, isFiltered, isFlattened, isInLoop, iterate, optimize, process, promote, refineVariableType, setFiltered, setFlattened, setStaticType, toString, typeCheck
Methods inherited from class net.sf.saxon.expr.Expression
adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getExpressionName, getHostLanguage, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, iterateSubExpressions, markTailFunctionCalls, replaceSubExpression, resetLocalStaticProperties, setContainer, setEvaluationMethod, setLocationId, simplify, staticTypeCheck, suppressValidation, typeError
-
Field Details
-
slotNumber
int slotNumber
-
-
Constructor Details
-
LocalVariableReference
public LocalVariableReference()Create a local variable reference. The binding and slot number will be supplied later -
LocalVariableReference
Create a LocalVariableReference bound to a given Binding- Parameters:
binding
- the binding (that is, the declaration of this local variable)
-
-
Method Details
-
copy
Create a clone copy of this VariableReference- Overrides:
copy
in classVariableReference
- Returns:
- the cloned copy
-
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
-
getSlotNumber
public int getSlotNumber()Get the slot number allocated to this local variable- Returns:
- the slot number
-
evaluateVariable
Return the value of the variable- Overrides:
evaluateVariable
in classVariableReference
- Parameters:
c
- the XPath dynamic context- Returns:
- the value of the variable
- Throws:
XPathException
- if any dynamic error occurs while evaluating the variable
-