org.exist.xquery
Class LocationStep

java.lang.Object
  extended by org.exist.xquery.AbstractExpression
      extended by org.exist.xquery.Step
          extended by org.exist.xquery.LocationStep
All Implemented Interfaces:
Expression

public class LocationStep
extends Step

Processes all location path steps (like descendant::*, ancestor::XXX). The results of the first evaluation of the expression are cached for the lifetime of the object and only reloaded if the context sequence (as passed to the eval(Sequence, Item) method) has changed.

Author:
wolf

Field Summary
 
Fields inherited from interface org.exist.xquery.Expression
DOT_TEST, EXPRESSION_ID_INVALID, IGNORE_CONTEXT, IN_NODE_CONSTRUCTOR, IN_PREDICATE, IN_UPDATE, IN_WHERE_CLAUSE, NEED_INDEX_INFO, NO_CONTEXT_ID, SINGLE_STEP_EXECUTION, USE_TREE_TRAVERSAL
 
Constructor Summary
LocationStep(XQueryContext context, int axis)
          Creates a new LocationStep instance.
LocationStep(XQueryContext context, int axis, NodeTest test)
          Creates a new LocationStep instance.
 
Method Summary
 void accept(ExpressionVisitor visitor)
          The method accept
 void analyze(AnalyzeContextInfo contextInfo)
          Statically analyze the expression and its subexpressions.
 Sequence eval(Sequence contextSequence, Item contextItem)
          The method eval
 int getDependencies()
          Returns Dependency.DEFAULT_DEPENDENCIES.
 Expression getParent()
          The method getParent
 void resetState(boolean postOptimization)
          Called to inform an expression that it should reset to its initial state.
 void setPreloadedData(DocumentSet docs, NodeSet nodes)
          The method setPreloadedData
 void setPreloadNodeSets(boolean doPreload)
          The method setPreloadNodeSets
 void setUseDirectAttrSelect(boolean useDirectAttrSelect)
          The method setUseDirectAttrSelect
 
Methods inherited from class org.exist.xquery.Step
addPredicate, dump, getAxis, getCardinality, getPredicates, getTest, hasPredicates, insertPredicate, returnsType, setAxis, setPrimaryAxis, setTest, toString
 
Methods inherited from class org.exist.xquery.AbstractExpression
eval, getASTNode, getContextDocSet, getContextId, getExpressionId, setASTNode, setContextDocSet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocationStep

public LocationStep(XQueryContext context,
                    int axis)
Creates a new LocationStep instance.

Parameters:
context - a XQueryContext value
axis - an int value

LocationStep

public LocationStep(XQueryContext context,
                    int axis,
                    NodeTest test)
Creates a new LocationStep instance.

Parameters:
context - a XQueryContext value
axis - an int value
test - a NodeTest value
Method Detail

getDependencies

public int getDependencies()
Description copied from class: AbstractExpression
Returns Dependency.DEFAULT_DEPENDENCIES.

Specified by:
getDependencies in interface Expression
Overrides:
getDependencies in class AbstractExpression
Returns:
set of bit-flags
See Also:
Expression.getDependencies()

setPreloadNodeSets

public void setPreloadNodeSets(boolean doPreload)
The method setPreloadNodeSets

Parameters:
doPreload - a boolean value

setPreloadedData

public void setPreloadedData(DocumentSet docs,
                             NodeSet nodes)
The method setPreloadedData

Parameters:
docs - a DocumentSet value
nodes - a NodeSet value

analyze

public void analyze(AnalyzeContextInfo contextInfo)
             throws XPathException
Description copied from interface: Expression
Statically analyze the expression and its subexpressions. During the static analysis phase, the query engine can detect unknown variables and some type errors.

Specified by:
analyze in interface Expression
Overrides:
analyze in class Step
Throws:
XPathException

eval

public Sequence eval(Sequence contextSequence,
                     Item contextItem)
              throws XPathException
The method eval

Specified by:
eval in interface Expression
Specified by:
eval in class Step
Parameters:
contextSequence - a Sequence value
contextItem - an Item value
Returns:
a Sequence value
Throws:
XPathException - if an error occurs

getParent

public Expression getParent()
The method getParent

Returns:
an Expression value

setUseDirectAttrSelect

public void setUseDirectAttrSelect(boolean useDirectAttrSelect)
The method setUseDirectAttrSelect

Parameters:
useDirectAttrSelect - a boolean value

accept

public void accept(ExpressionVisitor visitor)
The method accept

Specified by:
accept in interface Expression
Overrides:
accept in class AbstractExpression
Parameters:
visitor - an ExpressionVisitor value

resetState

public void resetState(boolean postOptimization)
Description copied from interface: Expression
Called to inform an expression that it should reset to its initial state. All cached data in the expression object should be dropped. For example, the xmldb:document() function calls this method whenever the input document set has changed.

Specified by:
resetState in interface Expression
Overrides:
resetState in class Step


Copyright (C) Wolfgang Meier. All rights reserved.