Package org.apache.xalan.xsltc.dom
Class ArrayNodeListIterator
java.lang.Object
org.apache.xalan.xsltc.dom.ArrayNodeListIterator
- All Implemented Interfaces:
Cloneable
,DTMAxisIterator
-
Field Summary
Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator
END
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getLast()
int
getNodeByPosition
(int position) Return the node at the given position.int
int
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.void
gotoMark()
Restores the current node remembered by setMark().boolean
int
next()
Get the next node in the iteration.reset()
Resets the iterator to the last start node.void
setMark()
Remembers the current node for the next call to gotoMark().void
setRestartable
(boolean isRestartable) Set if restartable.setStartNode
(int node) Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
-
Constructor Details
-
ArrayNodeListIterator
public ArrayNodeListIterator(int[] nodes)
-
-
Method Details
-
next
public int next()Description copied from interface:DTMAxisIterator
Get the next node in the iteration.- Specified by:
next
in interfaceDTMAxisIterator
- Returns:
- The next node handle in the iteration, or END.
-
reset
Description copied from interface:DTMAxisIterator
Resets the iterator to the last start node.- Specified by:
reset
in interfaceDTMAxisIterator
- Returns:
- A DTMAxisIterator, which may or may not be the same as this iterator.
-
getLast
public int getLast()- Specified by:
getLast
in 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:
getPosition
in interfaceDTMAxisIterator
- Returns:
- The position of the current node in the set, as defined by XPath.
-
setMark
public void setMark()Description copied from interface:DTMAxisIterator
Remembers the current node for the next call to gotoMark().- Specified by:
setMark
in interfaceDTMAxisIterator
-
gotoMark
public void gotoMark()Description copied from interface:DTMAxisIterator
Restores the current node remembered by setMark().- Specified by:
gotoMark
in interfaceDTMAxisIterator
-
setStartNode
Description copied from interface:DTMAxisIterator
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.- Specified by:
setStartNode
in 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:DTMAxisIterator
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.- Specified by:
getStartNode
in interfaceDTMAxisIterator
- Returns:
- The root node of the iteration.
-
isReverse
public boolean isReverse()- Specified by:
isReverse
in interfaceDTMAxisIterator
- Returns:
- true if this iterator has a reversed axis, else false.
-
cloneIterator
- Specified by:
cloneIterator
in 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:DTMAxisIterator
Set if restartable.- Specified by:
setRestartable
in interfaceDTMAxisIterator
-
getNodeByPosition
public int getNodeByPosition(int position) Description copied from interface:DTMAxisIterator
Return the node at the given position.- Specified by:
getNodeByPosition
in interfaceDTMAxisIterator
- Parameters:
position
- The position- Returns:
- The node at the given position.
-