APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xpath.internal.axes

public Class UnionPathIterator

extends LocPathIterator
implements Cloneable, DTMIterator, Serializable, PathComponent
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xpath.internal.axes.PathComponent, java.io.Serializable, com.sun.org.apache.xml.internal.dtm.DTMIterator, java.lang.Cloneable
Imports
com.sun.org.apache.xml.internal.dtm.Axis, .DTM, .DTMIterator, com.sun.org.apache.xml.internal.utils.QName, com.sun.org.apache.xpath.internal.Expression, .ExpressionOwner, .XPathVisitor, com.sun.org.apache.xpath.internal.compiler.Compiler, .OpCodes, .OpMap, java.util.List

This class extends NodeSetDTM, which implements DTMIterator, and fetches nodes one at a time in document order based on a XPath UnionExpr. As each node is iterated via nextNode(), the node is also stored in the NodeVector, so that previousNode() can easily be done.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
protected LocPathIterator[]
m_exprs

The location path iterators, one for each location path contained in the union expression.

protected DTMIterator[]
m_iterators

The location path iterators, one for each location path contained in the union expression.

pack-priv static final long
Inherited from com.sun.org.apache.xpath.internal.axes.LocPathIterator:
m_allowDetachm_cdtmm_clonesm_contextm_currentContextNodem_execContextm_lastFetchedm_lengthm_posm_stackFrame

Constructor Summary

AccessConstructor and Description
public
UnionPathIterator()

Constructor to create an instance which you can add location paths to.

public
UnionPathIterator(Compiler
The Compiler which is creating this expression.
compiler
,
int
The position of this iterator in the opcode list from the compiler.
opPos
)

Create a UnionPathIterator object, including creation of location path iterators from the opcode list, and call back into the Compiler to create predicate expressions.

Method Summary

Modifier and TypeMethod and Description
public void
addIterator(DTMIterator
non-null reference to a location path iterator.
expr
)

Add an iterator to the union list.

public void
callVisitors(ExpressionOwner owner, XPathVisitor visitor)

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.callVisitors.

Implements com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

This will traverse the heararchy, calling the visitor for each member.

public Object

Returns:

A clone of this iterator that holds the same node position.
clone
()

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.clone.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.clone.

Get a cloned LocPathIterator that holds the same position as this iterator.

protected LocPathIterator

Returns:

New location path iterator.
createDTMIterator
(Compiler
The Compiler which is creating this expression.
compiler
,
int
The position of this iterator in the
opPos
)

Create a new location path iterator.

public static LocPathIterator

Returns:

Object that is derived from LocPathIterator.
createUnionIterator
(Compiler
The Compiler which is creating this expression.
compiler
,
int
The position of this iterator in the opcode list from the compiler.
opPos
)

This will return an iterator capable of handling the union of paths given.

public boolean
deepEquals(Expression expr)

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.deepEquals.

Compare this object with another object and see if they are equal, include the sub heararchy.

public void
detach()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.detach.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.detach.

Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.

public void
fixupVariables(List<QName>
List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).
vars
,
int globalsSize)

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.fixupVariables.

This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

public int

Returns:

One of WalkerFactory#BIT_DESCENDANT, etc.
getAnalysisBits
()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.getAnalysisBits.

Implements com.sun.org.apache.xpath.internal.axes.PathComponent.getAnalysisBits.

Get the analysis bits for this walker, as defined in the WalkerFactory.

public int

Returns:

Axis.CHILD, etc., or -1 if the axis is not known or is of multiple types.
getAxis
()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.getAxis.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.getAxis.

Returns the axis being iterated, if it is known.

protected void
loadLocationPaths(Compiler
The Compiler which is creating this expression.
compiler
,
int
The position of this iterator in the opcode list from the compiler.
opPos
,
int
The insert position of the iterator.
count
)

Initialize the location path iterators.

public int

Returns:

The next Node in the set being iterated over, or null if there are no more members in that set.
nextNode
()

Implements abstract com.sun.org.apache.xpath.internal.axes.LocPathIterator.nextNode.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.nextNode.

Returns the next node in the set and advances the position of the iterator in the set.

private void
readObject(ObjectInputStream
Input stream to read from
stream
)

Hides com.sun.org.apache.xpath.internal.axes.LocPathIterator.readObject.

Read the object from a serialization stream.

public void
setRoot(int
The XPath runtime context for this transformation.
context
,
Object environment)

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.setRoot.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.setRoot.

Initialize the context values for this expression after it is cloned.

Inherited from com.sun.org.apache.xpath.internal.axes.LocPathIterator:
allowDetachToReleaseasIteratorasNodeboolcloneWithResetexecuteexecuteCharsToContentHandlergetContextgetCurrentContextNodegetCurrentNodegetCurrentPosgetDTMgetDTMManagergetExpandEntityReferencesgetFiltergetFoundLastgetIsTopLevelgetLastPosgetLengthgetPrefixResolvergetRootgetWhatToShowgetXPathContextincrementCurrentPosisDocOrderedisFreshisMutableisNodesetExpritempreviousNoderesetreturnNextNoderunTosetCurrentContextNodesetCurrentPossetEnvironmentsetIsTopLevelsetItemsetNextPositionsetShouldCacheNodessize

Field Detail

m_exprsback to summary
protected LocPathIterator[] m_exprs

The location path iterators, one for each location path contained in the union expression.

m_iteratorsback to summary
protected DTMIterator[] m_iterators

The location path iterators, one for each location path contained in the union expression.

Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.org.apache.xpath.internal.axes.LocPathIterator.serialVersionUID.

Constructor Detail

UnionPathIteratorback to summary
public UnionPathIterator()

Constructor to create an instance which you can add location paths to.

UnionPathIteratorback to summary
public UnionPathIterator(Compiler compiler, int opPos) throws TransformerException

Create a UnionPathIterator object, including creation of location path iterators from the opcode list, and call back into the Compiler to create predicate expressions.

Parameters
compiler:Compiler

The Compiler which is creating this expression.

opPos:int

The position of this iterator in the opcode list from the compiler.

Method Detail

addIteratorback to summary
public void addIterator(DTMIterator expr)

Add an iterator to the union list.

Parameters
expr:DTMIterator

non-null reference to a location path iterator.

callVisitorsback to summary
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.callVisitors.

Implements com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

Doc from com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

This will traverse the heararchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called.

See Also
com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.clone.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.clone.

Get a cloned LocPathIterator that holds the same position as this iterator.

Returns:Object

A clone of this iterator that holds the same node position.

Exceptions
CloneNotSupportedException:

Doc from java.lang.Object.clone.

if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

createDTMIteratorback to summary
protected LocPathIterator createDTMIterator(Compiler compiler, int opPos) throws TransformerException

Create a new location path iterator.

Parameters
compiler:Compiler

The Compiler which is creating this expression.

opPos:int

The position of this iterator in the

Returns:LocPathIterator

New location path iterator.

createUnionIteratorback to summary
public static LocPathIterator createUnionIterator(Compiler compiler, int opPos) throws TransformerException

This will return an iterator capable of handling the union of paths given.

Parameters
compiler:Compiler

The Compiler which is creating this expression.

opPos:int

The position of this iterator in the opcode list from the compiler.

Returns:LocPathIterator

Object that is derived from LocPathIterator.

deepEqualsback to summary
public boolean deepEquals(Expression expr)

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.deepEquals.

Doc from com.sun.org.apache.xpath.internal.Expression.deepEquals.

Compare this object with another object and see if they are equal, include the sub heararchy.

See Also
Expression#deepEquals(Expression)
detachback to summary
public void detach()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.detach.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.detach.

Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. Afterdetach has been invoked, calls to nextNode orpreviousNode will raise the exception INVALID_STATE_ERR.

fixupVariablesback to summary
public void fixupVariables(List<QName> vars, int globalsSize)

Overrides com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest.fixupVariables.

This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

Parameters
vars:List<QName>

List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).

getAnalysisBitsback to summary
public int getAnalysisBits()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.getAnalysisBits.

Implements com.sun.org.apache.xpath.internal.axes.PathComponent.getAnalysisBits.

Get the analysis bits for this walker, as defined in the WalkerFactory.

Returns:int

One of WalkerFactory#BIT_DESCENDANT, etc.

getAxisback to summary
public int getAxis()

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.getAxis.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.getAxis.

Returns the axis being iterated, if it is known.

Returns:int

Axis.CHILD, etc., or -1 if the axis is not known or is of multiple types.

loadLocationPathsback to summary
protected void loadLocationPaths(Compiler compiler, int opPos, int count) throws TransformerException

Initialize the location path iterators. Recursive.

Parameters
compiler:Compiler

The Compiler which is creating this expression.

opPos:int

The position of this iterator in the opcode list from the compiler.

count:int

The insert position of the iterator.

nextNodeback to summary
public int nextNode()

Implements abstract com.sun.org.apache.xpath.internal.axes.LocPathIterator.nextNode.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.nextNode.

Returns the next node in the set and advances the position of the iterator in the set. After a DTMIterator is created, the first call to nextNode() returns the first node in the set.

Returns:int

The next Node in the set being iterated over, or null if there are no more members in that set.

readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Hides com.sun.org.apache.xpath.internal.axes.LocPathIterator.readObject.

Read the object from a serialization stream.

Parameters
stream:ObjectInputStream

Input stream to read from

Exceptions
IOException:
in case of any IO related exceptions
ClassNotFoundException:
if Class of the serialized object cannot be found
setRootback to summary
public void setRoot(int context, Object environment)

Overrides com.sun.org.apache.xpath.internal.axes.LocPathIterator.setRoot.

Implements com.sun.org.apache.xml.internal.dtm.DTMIterator.setRoot.

Initialize the context values for this expression after it is cloned.

Parameters
context:int

The XPath runtime context for this transformation.

com.sun.org.apache.xpath.internal.axes back to summary

pack-priv Class UnionPathIterator.iterOwner

extends Object
implements ExpressionOwner
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xpath.internal.axes.UnionPathIterator.iterOwner
All Implemented Interfaces
com.sun.org.apache.xpath.internal.ExpressionOwner

Field Summary

Modifier and TypeField and Description
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
iterOwner(int index)

Method Summary

Modifier and TypeMethod and Description
public Expression
getExpression()

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Get the raw Expression object that this class wraps.

public void
setExpression(Expression exp)

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Set the raw expression object for this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_indexback to summary
pack-priv int m_index

Constructor Detail

iterOwnerback to summary
pack-priv iterOwner(int index)

Method Detail

getExpressionback to summary
public Expression getExpression()

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Doc from com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Get the raw Expression object that this class wraps.

See Also
ExpressionOwner#getExpression()
setExpressionback to summary
public void setExpression(Expression exp)

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Doc from com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Set the raw expression object for this object.

See Also
ExpressionOwner#setExpression(Expression)