org.exist.xpath
Class Union

java.lang.Object
  extended byorg.exist.xpath.PathExpr
      extended byorg.exist.xpath.Union
All Implemented Interfaces:
Expression

public class Union
extends PathExpr


Field Summary
protected  PathExpr left
           
protected  PathExpr right
           
 
Fields inherited from class org.exist.xpath.PathExpr
docs, inPredicate, keepVirtual, pool, steps
 
Constructor Summary
Union(BrokerPool pool, PathExpr left, PathExpr right)
           
 
Method Summary
 Value eval(DocumentSet docs, NodeSet context, NodeProxy node)
          Evaluate the expression represented by this object.
 java.lang.String pprint()
          Return a readable representation of this expression.
 DocumentSet preselect(DocumentSet in_docs)
          check relevant documents.
 int returnsType()
          The type of value, this expression returns.
 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 org.exist.xpath.PathExpr
add, add, addDocument, addPath, addPredicate, getDocumentSet, getExpression, getLength, preselect, setDocumentSet, setFirstExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

protected PathExpr left

right

protected PathExpr right
Constructor Detail

Union

public Union(BrokerPool pool,
             PathExpr left,
             PathExpr right)
Method Detail

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
Overrides:
returnsType in class PathExpr

preselect

public DocumentSet preselect(DocumentSet in_docs)
check relevant documents. if right operand is a string literal we check which documents contain it at all. in other cases do nothing.

Specified by:
preselect in interface Expression
Overrides:
preselect in class PathExpr

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
Overrides:
eval in class PathExpr

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
Overrides:
pprint in class PathExpr

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
Overrides:
setInPredicate in class PathExpr


Copyright (C) Wolfgang Meier. All rights reserved.