org.apache.commons.jxpath.ri.axes

Class UnionContext

Implemented Interfaces:
ExpressionContext, 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

Fields inherited from class org.apache.commons.jxpath.ri.EvalContext

parentContext, position, rootContext

Constructor Summary

UnionContext(EvalContext parentContext, 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, setPosition

Methods inherited from class org.apache.commons.jxpath.ri.EvalContext

getContextNodeList, getContextNodePointer, getCurrentNodePointer, getCurrentPosition, getDocumentOrder, getJXPathContext, getNodeSet, getPosition, getRootContext, getSingleNodePointer, getValue, hasNext, isChildOrderingRequired, next, nextNode, nextSet, remove, reset, setPosition, toString

Constructor Details

UnionContext

public UnionContext(EvalContext parentContext,
                    contexts[] )

Method Details

getDocumentOrder

public int getDocumentOrder()
Determines the document order for this context.
Overrides:
getDocumentOrder in interface EvalContext
Returns:
1 ascending order, -1 descending order, 0 - does not require ordering

setPosition

public boolean setPosition(int position)
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 interface NodeSetContext