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

public Class OneStepIterator

extends ChildTestIterator
Class Inheritance
Imports
com.sun.org.apache.xml.internal.dtm.DTM, .DTMAxisIterator, .DTMFilter, .DTMIterator, com.sun.org.apache.xpath.internal.Expression, .XPathContext, com.sun.org.apache.xpath.internal.compiler.Compiler, .OpMap

This class implements a general iterator for those LocationSteps with only one step, and perhaps a predicate.
See Also
com.sun.org.apache.xpath.internal.axes#LocPathIterator

Field Summary

Modifier and TypeField and Description
protected int
m_axis

The traversal axis from where the nodes will be filtered.

protected DTMAxisIterator
m_iterator

The DTM inner traversal class, that corresponds to the super axis.

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

Constructor Summary

AccessConstructor and Description
pack-priv
OneStepIterator(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 OneStepIterator object.

public
OneStepIterator(DTMAxisIterator
The DTM iterator which this iterator will use.
iterator
,
int
One of Axis.Child, etc., or -1 if the axis is unknown.
axis
)

Create a OneStepIterator object.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

A new iterator that can be used without mutating this one.
clone
()

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

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

Get a cloned iterator.

public DTMIterator

Returns:

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

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

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

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

protected void
countProximityPosition(int
The predicate index.
i
)

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

Count backwards one proximity position.

public boolean
deepEquals(Expression
Another expression object.
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.ChildTestIterator.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.ChildTestIterator.getAxis.

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

Returns the axis being iterated, if it is known.

public int

Returns:

The number of nodes in the list, always greater or equal to zero.
getLength
()

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

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

The number of nodes in the list.

protected int
getNextNode()

Overrides com.sun.org.apache.xpath.internal.axes.ChildTestIterator.getNextNode.

Get the next node via getFirstAttribute && getNextAttribute.

protected int

Returns:

The pridicate index, or -1.
getProximityPosition
(int
The predicate index of the proximity position.
predicateIndex
)

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

Get the current sub-context position.

public boolean

Returns:

true for this class.
isReverseAxes
()

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

Tells if this is a reverse axes.

public void
public void
setRoot(int
The XPath runtime context for this transformation.
context
,
Object
The environment object. The environment in which this iterator operates, which should provide:
  • a node (the context node... same value as "root" defined below)
  • a pair of non-zero positive integers (the context position and the context size)
  • a set of variable bindings
  • a function library
  • the set of namespace declarations in scope for the expression.
    • At this time the exact implementation of this environment is application dependent. Probably a proper interface will be created fairly soon.

environment
)

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

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

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

Field Detail

m_axisback to summary
protected int m_axis

The traversal axis from where the nodes will be filtered.

m_iteratorback to summary
protected DTMAxisIterator m_iterator

The DTM inner traversal class, that corresponds to the super axis.

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

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

Constructor Detail

OneStepIteratorback to summary
pack-priv OneStepIterator(Compiler compiler, int opPos, int analysis) throws TransformerException

Create a OneStepIterator 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.

OneStepIteratorback to summary
public OneStepIterator(DTMAxisIterator iterator, int axis) throws TransformerException

Create a OneStepIterator object.

Parameters
iterator:DTMAxisIterator

The DTM iterator which this iterator will use.

axis:int

One of Axis.Child, etc., or -1 if the axis is unknown.

Method Detail

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

Returns:Object

A new iterator that can be used without mutating this one.

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.

cloneWithResetback to summary
public DTMIterator cloneWithReset() throws CloneNotSupportedException

Overrides com.sun.org.apache.xpath.internal.axes.ChildTestIterator.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.

countProximityPositionback to summary
protected void countProximityPosition(int i)

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

Count backwards one proximity position.

Parameters
i:int

The predicate index.

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.

Parameters
expr:Expression

Another expression object.

Returns:boolean

true if this objects class and the expr object's class are the same, and the data contained within both objects are considered equal.

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

Overrides com.sun.org.apache.xpath.internal.axes.ChildTestIterator.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.ChildTestIterator.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.

getLengthback to summary
public int getLength()

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

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

The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.

Returns:int

The number of nodes in the list, always greater or equal to zero.

getNextNodeback to summary
protected int getNextNode()

Overrides com.sun.org.apache.xpath.internal.axes.ChildTestIterator.getNextNode.

Get the next node via getFirstAttribute && getNextAttribute.

Returns:int

Doc from com.sun.org.apache.xpath.internal.axes.ChildTestIterator.getNextNode.

The next node on the axis, or DTM.NULL.

getProximityPositionback to summary
protected int getProximityPosition(int predicateIndex)

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

Get the current sub-context position. In order to do the reverse axes count, for the moment this re-searches the axes up to the predicate. An optimization on this is to cache the nodes searched, but, for the moment, this case is probably rare enough that the added complexity isn't worth it.

Parameters
predicateIndex:int

The predicate index of the proximity position.

Returns:int

The pridicate index, or -1.

isReverseAxesback to summary
public boolean isReverseAxes()

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

Tells if this is a reverse axes. Overrides AxesWalker#isReverseAxes.

Returns:boolean

true for this class.

resetback to summary
public void reset()

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

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

Reset the iterator.

setRootback to summary
public void setRoot(int context, Object environment)

Overrides com.sun.org.apache.xpath.internal.axes.ChildTestIterator.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.

environment:Object

Doc from com.sun.org.apache.xml.internal.dtm.DTMIterator.setRoot.

The environment object. The environment in which this iterator operates, which should provide:

  • a node (the context node... same value as "root" defined below)
  • a pair of non-zero positive integers (the context position and the context size)
  • a set of variable bindings
  • a function library
  • the set of namespace declarations in scope for the expression.
    • At this time the exact implementation of this environment is application dependent. Probably a proper interface will be created fairly soon.