Package org.apache.xalan.xsltc.dom
Class ArrayNodeListIterator
- java.lang.Object
-
- org.apache.xalan.xsltc.dom.ArrayNodeListIterator
-
- All Implemented Interfaces:
java.lang.Cloneable,DTMAxisIterator
public class ArrayNodeListIterator extends java.lang.Object implements DTMAxisIterator
-
-
Field Summary
-
Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator
END
-
-
Constructor Summary
Constructors Constructor Description ArrayNodeListIterator(int[] nodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DTMAxisIteratorcloneIterator()intgetLast()intgetNodeByPosition(int position)Return the node at the given position.intgetPosition()intgetStartNode()Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.voidgotoMark()Restores the current node remembered by setMark().booleanisReverse()intnext()Get the next node in the iteration.DTMAxisIteratorreset()Resets the iterator to the last start node.voidsetMark()Remembers the current node for the next call to gotoMark().voidsetRestartable(boolean isRestartable)Set if restartable.DTMAxisIteratorsetStartNode(int node)Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
-
-
-
Method Detail
-
next
public int next()
Description copied from interface:DTMAxisIteratorGet the next node in the iteration.- Specified by:
nextin interfaceDTMAxisIterator- Returns:
- The next node handle in the iteration, or END.
-
reset
public DTMAxisIterator reset()
Description copied from interface:DTMAxisIteratorResets the iterator to the last start node.- Specified by:
resetin interfaceDTMAxisIterator- Returns:
- A DTMAxisIterator, which may or may not be the same as this iterator.
-
getLast
public int getLast()
- Specified by:
getLastin interfaceDTMAxisIterator- Returns:
- the number of nodes in this iterator. This may be an expensive operation when called the first time.
-
getPosition
public int getPosition()
- Specified by:
getPositionin interfaceDTMAxisIterator- Returns:
- The position of the current node in the set, as defined by XPath.
-
setMark
public void setMark()
Description copied from interface:DTMAxisIteratorRemembers the current node for the next call to gotoMark().- Specified by:
setMarkin interfaceDTMAxisIterator
-
gotoMark
public void gotoMark()
Description copied from interface:DTMAxisIteratorRestores the current node remembered by setMark().- Specified by:
gotoMarkin interfaceDTMAxisIterator
-
setStartNode
public DTMAxisIterator setStartNode(int node)
Description copied from interface:DTMAxisIteratorSet start to END should 'close' the iterator, i.e. subsequent call to next() should return END.- Specified by:
setStartNodein interfaceDTMAxisIterator- Parameters:
node- Sets the root of the iteration.- Returns:
- A DTMAxisIterator set to the start of the iteration.
-
getStartNode
public int getStartNode()
Description copied from interface:DTMAxisIteratorGet start to END should 'close' the iterator, i.e. subsequent call to next() should return END.- Specified by:
getStartNodein interfaceDTMAxisIterator- Returns:
- The root node of the iteration.
-
isReverse
public boolean isReverse()
- Specified by:
isReversein interfaceDTMAxisIterator- Returns:
- true if this iterator has a reversed axis, else false.
-
cloneIterator
public DTMAxisIterator cloneIterator()
- Specified by:
cloneIteratorin interfaceDTMAxisIterator- Returns:
- a deep copy of this iterator. The clone should not be reset from its current position.
-
setRestartable
public void setRestartable(boolean isRestartable)
Description copied from interface:DTMAxisIteratorSet if restartable.- Specified by:
setRestartablein interfaceDTMAxisIterator
-
getNodeByPosition
public int getNodeByPosition(int position)
Description copied from interface:DTMAxisIteratorReturn the node at the given position.- Specified by:
getNodeByPositionin interfaceDTMAxisIterator- Parameters:
position- The position- Returns:
- The node at the given position.
-
-