org.apache.commons.jxpath.ri.axes
Class UnionContext

java.lang.Object
  extended byorg.apache.commons.jxpath.ri.EvalContext
      extended byorg.apache.commons.jxpath.ri.axes.NodeSetContext
          extended byorg.apache.commons.jxpath.ri.axes.UnionContext
All Implemented Interfaces:
ExpressionContext, java.util.Iterator

public class UnionContext
extends NodeSetContext

EvalContext that represents a union between other contexts - result of a union operation like (a | b)

Version:
$Revision: 1.12 $ $Date: 2004/02/29 14:17:38 $
Author:
Dmitri Plotnikov

Field Summary
private  EvalContext[] contexts
           
private  boolean prepared
           
private  boolean startedSet
           
 
Fields inherited from class org.apache.commons.jxpath.ri.axes.NodeSetContext
 
Fields inherited from class org.apache.commons.jxpath.ri.EvalContext
parentContext, position, rootContext
 
Constructor Summary
UnionContext(EvalContext parentContext, EvalContext[] contexts)
           
 
Method Summary
 int getDocumentOrder()
          Determines the document order for this context.
 boolean setPosition(int position)
          Moves the current position to the specified index.
 
Methods inherited from class org.apache.commons.jxpath.ri.axes.NodeSetContext
getCurrentNodePointer, getNodeSet, nextNode, nextSet
 
Methods inherited from class org.apache.commons.jxpath.ri.EvalContext
getContextNodeList, getContextNodePointer, getCurrentPosition, getJXPathContext, getPosition, getRootContext, getSingleNodePointer, getValue, hasNext, isChildOrderingRequired, next, remove, reset, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startedSet

private boolean startedSet

contexts

private EvalContext[] contexts

prepared

private boolean prepared
Constructor Detail

UnionContext

public UnionContext(EvalContext parentContext,
                    EvalContext[] contexts)
Method Detail

getDocumentOrder

public int getDocumentOrder()
Description copied from class: EvalContext
Determines the document order for this context.

Overrides:
getDocumentOrder in class EvalContext
Returns:
1 ascending order, -1 descending order, 0 - does not require ordering

setPosition

public boolean setPosition(int position)
Description copied from class: EvalContext
Moves the current position to the specified index. Used with integer predicates to quickly get to the n'th element of the node set. Returns false if the position is out of the node set range. You can call it with 0 as the position argument to restart the iteration.

Overrides:
setPosition in class NodeSetContext