Class UnionContext
- java.lang.Object
-
- org.apache.commons.jxpath.ri.EvalContext
-
- org.apache.commons.jxpath.ri.axes.NodeSetContext
-
- org.apache.commons.jxpath.ri.axes.UnionContext
-
- All Implemented Interfaces:
java.util.Iterator
,ExpressionContext
public class UnionContext extends NodeSetContext
EvalContext that represents a union between other contexts - result of a union operation like (a | b)- Version:
- $Revision: 652845 $ $Date: 2008-05-02 12:46:46 -0500 (Fri, 02 May 2008) $
-
-
Field Summary
Fields Modifier and Type Field Description private EvalContext[]
contexts
private boolean
prepared
-
Fields inherited from class org.apache.commons.jxpath.ri.EvalContext
parentContext, position, rootContext
-
-
Constructor Summary
Constructors Constructor Description UnionContext(EvalContext parentContext, EvalContext[] contexts)
Create a new UnionContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, sortPointers, toString
-
-
-
-
Field Detail
-
contexts
private EvalContext[] contexts
-
prepared
private boolean prepared
-
-
Constructor Detail
-
UnionContext
public UnionContext(EvalContext parentContext, EvalContext[] contexts)
Create a new UnionContext.- Parameters:
parentContext
- parent contextcontexts
- child contexts
-
-
Method Detail
-
getDocumentOrder
public int getDocumentOrder()
Description copied from class:EvalContext
Determines the document order for this context.- Overrides:
getDocumentOrder
in classEvalContext
- 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 classNodeSetContext
- Parameters:
position
- to set- Returns:
- boolean
-
-