Package org.htmlunit.xpath.xml.dtm.ref
Class DTMDefaultBaseIterators.PrecedingIterator
- java.lang.Object
-
- org.htmlunit.xpath.xml.dtm.ref.DTMAxisIteratorBase
-
- org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseIterators.InternalAxisIteratorBase
-
- org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseIterators.PrecedingIterator
-
- All Implemented Interfaces:
java.lang.Cloneable,DTMAxisIterator
- Enclosing class:
- DTMDefaultBaseIterators
public class DTMDefaultBaseIterators.PrecedingIterator extends DTMDefaultBaseIterators.InternalAxisIteratorBase
Iterator that returns preceding nodes of a given node. This includes the node set {root+1, start-1}, but excludes all ancestors, attributes, and namespace nodes.
-
-
Field Summary
Fields Modifier and Type Field Description private int_maxAncestorsThe max ancestors, but it can grow...protected int_oldsp(not sure yet...protected int_sp(not sure yet...protected int[]_stackThe stack of start node + ancestors up to the root of the tree, which we must avoid.-
Fields inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseIterators.InternalAxisIteratorBase
_currentNode
-
Fields inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMAxisIteratorBase
_includeSelf, _isRestartable, _position, _startNode
-
Fields inherited from interface org.htmlunit.xpath.xml.dtm.DTMAxisIterator
END
-
-
Constructor Summary
Constructors Constructor Description PrecedingIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DTMAxisIteratorcloneIterator()Returns a deep copy of this iterator.booleanisReverse()intnext()Get the next node in the iteration.voidreset()Resets the iterator to the last start node.voidsetStartNode(int node)Set start to END should 'close' the iterator, i.e.-
Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMAxisIteratorBase
includeSelf, resetPosition, returnNode
-
-
-
-
Field Detail
-
_maxAncestors
private final int _maxAncestors
The max ancestors, but it can grow...- See Also:
- Constant Field Values
-
_stack
protected int[] _stack
The stack of start node + ancestors up to the root of the tree, which we must avoid.
-
_sp
protected int _sp
(not sure yet... -sb)
-
_oldsp
protected int _oldsp
(not sure yet... -sb)
-
-
Method Detail
-
isReverse
public boolean isReverse()
- Specified by:
isReversein interfaceDTMAxisIterator- Overrides:
isReversein classDTMAxisIteratorBase- Returns:
- true if this iterator has a reversed axis, else false
-
cloneIterator
public DTMAxisIterator cloneIterator()
Returns a deep copy of this iterator. Cloned iterators may not be restartable. The iterator being cloned may or may not become non-restartable as a side effect of this operation.- Specified by:
cloneIteratorin interfaceDTMAxisIterator- Overrides:
cloneIteratorin classDTMAxisIteratorBase- Returns:
- a deep copy of this iterator.
-
setStartNode
public void setStartNode(int node)
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.- Parameters:
node- Sets the root of the iteration.
-
next
public int next()
Get the next node in the iteration.- Returns:
- The next node handle in the iteration, or END.
-
reset
public void reset()
Resets the iterator to the last start node.- Specified by:
resetin interfaceDTMAxisIterator- Overrides:
resetin classDTMAxisIteratorBase
-
-