org.exist.xpath
Class PathExpr

java.lang.Object
  extended byorg.exist.xpath.PathExpr
All Implemented Interfaces:
Expression
Direct Known Subclasses:
BinaryOp, Function, Predicate, Union

public class PathExpr
extends java.lang.Object
implements Expression


Field Summary
protected  DocumentSet docs
           
protected  boolean inPredicate
           
protected  boolean keepVirtual
           
protected static org.apache.log4j.Logger LOG
           
protected  BrokerPool pool
           
protected  java.util.LinkedList steps
           
 
Constructor Summary
PathExpr(BrokerPool pool)
           
 
Method Summary
 void add(Expression s)
           
 void add(PathExpr path)
           
 void addDocument(DocumentImpl doc)
           
 void addPath(PathExpr path)
           
 void addPredicate(Predicate pred)
           
 Value eval(DocumentSet docs, NodeSet context, NodeProxy node)
          Evaluate the expression represented by this object.
 DocumentSet getDocumentSet()
           
 Expression getExpression(int pos)
           
 int getLength()
           
 java.lang.String pprint()
          Return a readable representation of this expression.
 DocumentSet preselect()
           
 DocumentSet preselect(DocumentSet in_docs)
          Determine the documents, taken from in_docs, for which this expression will possibly yield a result.
 int returnsType()
          The type of value, this expression returns.
 void setDocumentSet(DocumentSet docs)
           
 void setFirstExpression(Expression s)
           
 void setInPredicate(boolean inPredicate)
          This method is called to inform the expression object that it is executed inside an XPath predicate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG

docs

protected DocumentSet docs

keepVirtual

protected boolean keepVirtual

pool

protected BrokerPool pool

steps

protected java.util.LinkedList steps

inPredicate

protected boolean inPredicate
Constructor Detail

PathExpr

public PathExpr(BrokerPool pool)
Method Detail

add

public void add(Expression s)

add

public void add(PathExpr path)

addDocument

public void addDocument(DocumentImpl doc)

addPath

public void addPath(PathExpr path)

addPredicate

public void addPredicate(Predicate pred)

eval

public Value eval(DocumentSet docs,
                  NodeSet context,
                  NodeProxy node)
Description copied from interface: Expression
Evaluate the expression represented by this object. Depending on the context in which this expression is executed, either context, node or both of them may be set. An implementing class should know how to handle this. Most classes only expect context to contain a list of nodes which represents the current context of this expression.

Specified by:
eval in interface Expression
Parameters:
docs - the set of documents all nodes belong to.
context - the node-set which defines the current context node-set.
node - a single node, taken from context. This defines the node, the expression should work on.

getDocumentSet

public DocumentSet getDocumentSet()

getExpression

public Expression getExpression(int pos)

getLength

public int getLength()

pprint

public java.lang.String pprint()
Description copied from interface: Expression
Return a readable representation of this expression. This method is called whenever the xpath-query should be displayed to the user.

Specified by:
pprint in interface Expression

preselect

public DocumentSet preselect()

preselect

public DocumentSet preselect(DocumentSet in_docs)
Description copied from interface: Expression
Determine the documents, taken from in_docs, for which this expression will possibly yield a result. An expression does not have to do anything here. It may simply return in_docs. This method is used to restrict the range of documents in question for a given xpath-expression. It is called before the xpath-expression is actually executed.

Specified by:
preselect in interface Expression

returnsType

public int returnsType()
Description copied from interface: Expression
The type of value, this expression returns. Depending on the type of expression, this method should return one of the constants defined in class Constants, e.g. TYPE_NODELIST, TYPE_STRING, TYPE_NUM, TYPE_BOOL.

Specified by:
returnsType in interface Expression

setDocumentSet

public void setDocumentSet(DocumentSet docs)

setFirstExpression

public void setFirstExpression(Expression s)

setInPredicate

public void setInPredicate(boolean inPredicate)
Description copied from interface: Expression
This method is called to inform the expression object that it is executed inside an XPath predicate.

Specified by:
setInPredicate in interface Expression
Parameters:
inPredicate -


Copyright (C) Wolfgang Meier. All rights reserved.