Methods Summary |
---|
public com.sun.org.apache.xalan.internal.xsltc.NodeIterator | cloneIterator()Clones and resets this iterator. Note that the cloned iterator is
not restartable. This is because cloning is needed for variable
references, and the context node of the original variable
declaration must be preserved.
try {
final NodeIteratorBase clone = (NodeIteratorBase)super.clone();
clone._isRestartable = false;
return clone.reset();
}
catch (CloneNotSupportedException e) {
BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
e.toString());
return null;
}
|
public int | getLast()Default implementation of getLast(). Stores current position
and current node, resets the iterator, counts all nodes and
restores iterator to original state.
if (_last == -1) {
final int temp = _position;
setMark();
reset();
do {
_last++;
} while (next() != END);
gotoMark();
_position = temp;
}
return _last;
|
public int | getPosition()Returns the position() in this iterator.
return _position == 0 ? 1 : _position;
|
public com.sun.org.apache.xalan.internal.xsltc.NodeIterator | includeSelf()Setter for _includeSelf flag.
_includeSelf = true;
return this;
|
public boolean | isReverse()Indicates if position in this iterator is computed in reverse
document order. Note that nodes are always returned in document
order.
return false;
|
public com.sun.org.apache.xalan.internal.xsltc.NodeIterator | reset()Reset this iterator using state from last call to
setStartNode().
final boolean temp = _isRestartable;
_isRestartable = true;
// Must adjust _startNode if self is included
setStartNode(_includeSelf ? _startNode + 1 : _startNode);
_isRestartable = temp;
return this;
|
protected final com.sun.org.apache.xalan.internal.xsltc.NodeIterator | resetPosition()Reset the position in this iterator.
_position = 0;
return this;
|
protected final int | returnNode(int node)Utility method that increments position and returns its
argument.
_position++;
return node;
|
public void | setRestartable(boolean isRestartable)Setter for _isRestartable flag.
_isRestartable = isRestartable;
|
public abstract com.sun.org.apache.xalan.internal.xsltc.NodeIterator | setStartNode(int node)Initialize iterator using a node. If iterator is not
restartable, then do nothing. If node is equal to END then
subsequent calls to next() must return END.
|