lux.xpath
Class PathExpression

java.lang.Object
  extended by lux.xpath.AbstractExpression
      extended by lux.xpath.PathExpression
All Implemented Interfaces:
Visitable

public class PathExpression
extends AbstractExpression

A path expression represents two expressions joined with a "/"

Author:
sokolov

Nested Class Summary
 
Nested classes/interfaces inherited from class lux.xpath.AbstractExpression
AbstractExpression.Type
 
Field Summary
 
Fields inherited from class lux.xpath.AbstractExpression
subs, sup
 
Constructor Summary
PathExpression(AbstractExpression lhs, AbstractExpression rhs)
           
 
Method Summary
 AbstractExpression accept(ExpressionVisitor visitor)
           
 VariableContext getBindingContext()
          If this expression depends "directly" on a variable, return that variable's binding context: a for or let clause, or a global variable definition.
 AbstractExpression getLastContextStep()
          This method is called by the optimizer in order to determine an element or attribute QName (or wildcard) against which some expression is being compared, in order to generate an appropriate text query.
 AbstractExpression getLHS()
           
 int getPrecedence()
           
 AbstractExpression getRHS()
           
 AbstractExpression getRoot()
          Whenever we see a new absolute context (/, collection(), search()), its dependent expressions are a possible target for optimization.
 AbstractExpression getTail()
           
 void toString(StringBuilder buf)
          Each subclass must implement the toString(StringBuilder) method by rendering itself as a syntatically valid XPath/XQuery expression in the given buffer.
 
Methods inherited from class lux.xpath.AbstractExpression
acceptSubs, appendSub, getSubs, getSuper, getType, isAbsolute, isDocumentOrdered, replaceRoot, setSubs, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathExpression

public PathExpression(AbstractExpression lhs,
                      AbstractExpression rhs)
Method Detail

getRHS

public final AbstractExpression getRHS()

getLHS

public final AbstractExpression getLHS()

getPrecedence

public int getPrecedence()
Specified by:
getPrecedence in class AbstractExpression
Returns:
18

toString

public void toString(StringBuilder buf)
Description copied from class: AbstractExpression
Each subclass must implement the toString(StringBuilder) method by rendering itself as a syntatically valid XPath/XQuery expression in the given buffer.

Specified by:
toString in class AbstractExpression

getRoot

public AbstractExpression getRoot()
Whenever we see a new absolute context (/, collection(), search()), its dependent expressions are a possible target for optimization.

Overrides:
getRoot in class AbstractExpression
Returns:
the root of this path, or null if it is not an absolute path.

accept

public AbstractExpression accept(ExpressionVisitor visitor)

getTail

public AbstractExpression getTail()
Overrides:
getTail in class AbstractExpression
Returns:
the expression remaining after removing the left-most sub-expression (the CDR).

getLastContextStep

public AbstractExpression getLastContextStep()
Description copied from class: AbstractExpression
This method is called by the optimizer in order to determine an element or attribute QName (or wildcard) against which some expression is being compared, in order to generate an appropriate text query.

Overrides:
getLastContextStep in class AbstractExpression
Returns:
the rightmost step of this path expression

getBindingContext

public VariableContext getBindingContext()
Description copied from class: AbstractExpression
If this expression depends "directly" on a variable, return that variable's binding context: a for or let clause, or a global variable definition. This recurses through variables, so if there are aliases it retrieves the ultimate context. We need to define directly dependent precisely; what it's used for is to determine with an order by expression is dependent on a for-variable, and ultimately whether an order by optimization can be applied.

Overrides:
getBindingContext in class AbstractExpression
Returns:
the context in which a variable in the LHS of the path is bound, if any


Copyright © 2013. All Rights Reserved.