org.apache.xpath.axes

Class OneStepIterator

public class OneStepIterator extends ChildTestIterator

This class implements a general iterator for those LocationSteps with only one step, and perhaps a predicate.

See Also: org.apache.xpath.axes#LocPathIterator

UNKNOWN: advanced

Constructor Summary
OneStepIterator(DTMAxisIterator iterator, int axis)
Create a OneStepIterator object.
Method Summary
Objectclone()
Get a cloned iterator.
DTMIteratorcloneWithReset()
Get a cloned Iterator that is reset to the beginning of the query.
booleandeepEquals(Expression expr)
voiddetach()
Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.
intgetAxis()
Returns the axis being iterated, if it is known.
intgetLength()
The number of nodes in the list.
booleanisReverseAxes()
Tells if this is a reverse axes.
voidreset()
Reset the iterator.
voidsetRoot(int context, Object environment)
Initialize the context values for this expression after it is cloned.

Constructor Detail

OneStepIterator

public OneStepIterator(DTMAxisIterator iterator, int axis)
Create a OneStepIterator object.

Parameters: iterator The DTM iterator which this iterator will use. axis One of Axis.Child, etc., or -1 if the axis is unknown.

Throws: javax.xml.transform.TransformerException

Method Detail

clone

public Object clone()
Get a cloned iterator.

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

Throws: CloneNotSupportedException

cloneWithReset

public DTMIterator cloneWithReset()
Get a cloned Iterator that is reset to the beginning of the query.

Returns: A cloned NodeIterator set of the start of the query.

Throws: CloneNotSupportedException

deepEquals

public boolean deepEquals(Expression expr)

See Also: deepEquals

detach

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

getAxis

public int getAxis()
Returns the axis being iterated, if it is known.

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

getLength

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

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

isReverseAxes

public boolean isReverseAxes()
Tells if this is a reverse axes. Overrides AxesWalker#isReverseAxes.

Returns: true for this class.

reset

public void reset()
Reset the iterator.

setRoot

public void setRoot(int context, Object environment)
Initialize the context values for this expression after it is cloned.

Parameters: context The XPath runtime context for this transformation.

Copyright B) 2006 Apache XML Project. All Rights Reserved.