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

public Class DescendantIterator

extends LocPathIterator
Class Inheritance
Imports
com.sun.org.apache.xml.internal.dtm.Axis, .DTM, .DTMAxisTraverser, .DTMFilter, .DTMIterator, com.sun.org.apache.xpath.internal.Expression, .XPathContext, com.sun.org.apache.xpath.internal.compiler.Compiler, .OpCodes, .OpMap, com.sun.org.apache.xpath.internal.patterns.NodeTest, org.w3c.dom.DOMException

This class implements an optimized iterator for descendant, descendant-or-self, or "//foo" patterns.
See Also
com.sun.org.apache.xpath.internal.axes.LocPathIterator

Field Summary

Modifier and TypeField and Description
protected int
m_axis

The axis that we are traversing.

protected int
m_extendedTypeID

The extended type ID, not set until setRoot.

protected transient DTMAxisTraverser
m_traverser

The traverser to use to navigate over the descendants.

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
pack-priv
DescendantIterator(Compiler
A reference to the Compiler that contains the op map.
compiler
,
int
The position within the op map, which contains the location path expression for this itterator.
opPos
,
int analysis)

Create a DescendantIterator object.

public
DescendantIterator()

Create a DescendantIterator object.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the first node out of the nodeset, or DTM.NULL.
asNode
(XPathContext
The XPath runtime context.
xctxt
)

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

Return the first node out of the nodeset, if this expression is a nodeset expression.

public DTMIterator

Returns:

A cloned NodeIterator set of the start of the query.
cloneWithReset
()

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

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

Get a cloned Iterator that is reset to the beginning of the query.

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 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.

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.

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:
allowDetachToReleaseasIteratorboolcallVisitorsexecuteexecuteCharsToContentHandlergetAnalysisBitsgetContextgetCurrentContextNodegetCurrentNodegetCurrentPosgetDTMgetDTMManagergetExpandEntityReferencesgetFiltergetFoundLastgetIsTopLevelgetLastPosgetLengthgetPrefixResolvergetRootgetWhatToShowgetXPathContextincrementCurrentPosisDocOrderedisFreshisMutableisNodesetExpritempreviousNoderesetreturnNextNoderunTosetCurrentContextNodesetCurrentPossetEnvironmentsetIsTopLevelsetItemsetNextPositionsetShouldCacheNodessize

Field Detail

m_axisback to summary
protected int m_axis

The axis that we are traversing.

m_extendedTypeIDback to summary
protected int m_extendedTypeID

The extended type ID, not set until setRoot.

m_traverserback to summary
protected transient DTMAxisTraverser m_traverser

The traverser to use to navigate over the descendants.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

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

Constructor Detail

DescendantIteratorback to summary
pack-priv DescendantIterator(Compiler compiler, int opPos, int analysis) throws TransformerException

Create a DescendantIterator object.

Parameters
compiler:Compiler

A reference to the Compiler that contains the op map.

opPos:int

The position within the op map, which contains the location path expression for this itterator.

DescendantIteratorback to summary
public DescendantIterator()

Create a DescendantIterator object.

Method Detail

asNodeback to summary
public int asNode(XPathContext xctxt) throws TransformerException

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

Return the first node out of the nodeset, if this expression is a nodeset expression. This is the default implementation for nodesets.

Warning

Do not mutate this class from this function!

Parameters
xctxt:XPathContext

The XPath runtime context.

Returns:int

the first node out of the nodeset, or DTM.NULL.

cloneWithResetback to summary
public DTMIterator cloneWithReset() throws CloneNotSupportedException

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

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

Get a cloned Iterator that is reset to the beginning of the query.

Returns:DTMIterator

A cloned NodeIterator set of the start of the query.

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.

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.

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 NodeIterator 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.

Exceptions
DOMException:
INVALID_STATE_ERR: Raised if this method is called after the detach method was invoked.
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.