Fields Summary |
---|
private boolean | _docOrderA flag indicating if nodes are returned in document order. |
private DTMAxisIterator | _sourceThe source for this iterator. |
private final CurrentNodeListFilter | _filterA reference to a filter object. |
private IntegerArray | _nodesAn integer array to store nodes from source iterator. |
private int | _currentIndexIndex in _nodes of the next node to filter. |
private final int | _currentNodeThe current node in the stylesheet at the time of evaluation. |
private AbstractTranslet | _transletA reference to the translet. |
Methods Summary |
---|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | cloneIterator()
try {
final CurrentNodeListIterator clone =
(CurrentNodeListIterator) super.clone();
clone._nodes = (IntegerArray) _nodes.clone();
clone._source = _source.cloneIterator();
clone._isRestartable = false;
return clone.reset();
}
catch (CloneNotSupportedException e) {
BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
e.toString());
return null;
}
|
private int | computePositionOfLast()
final int last = _nodes.cardinality();
final int currNode = _currentNode;
final AbstractTranslet translet = _translet;
int lastPosition = _position;
for (int index = _currentIndex; index < last; ) {
final int position = _docOrder ? index + 1 : last - index;
int nodeIndex = _nodes.at(index++); // note increment
if (_filter.test(nodeIndex, position, last, currNode, translet,
this)) {
lastPosition++;
}
}
return lastPosition;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | forceNaturalOrder()
_docOrder = true;
return this;
|
public int | getLast()
if (_last == -1) {
_last = computePositionOfLast();
}
return _last;
|
public void | gotoMark()
_currentIndex = _markedNode;
|
public boolean | isReverse()
return !_docOrder;
|
public int | next()
final int last = _nodes.cardinality();
final int currentNode = _currentNode;
final AbstractTranslet translet = _translet;
for (int index = _currentIndex; index < last; ) {
final int position = _docOrder ? index + 1 : last - index;
final int node = _nodes.at(index++); // note increment
if (_filter.test(node, position, last, currentNode, translet,
this)) {
_currentIndex = index;
return returnNode(node);
}
}
return END;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | reset()
_currentIndex = 0;
return resetPosition();
|
public void | setMark()
_markedNode = _currentIndex;
|
public void | setRestartable(boolean isRestartable)
_isRestartable = isRestartable;
_source.setRestartable(isRestartable);
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | setStartNode(int node)
if (_isRestartable) {
_source.setStartNode(_startNode = node);
_nodes.clear();
while ((node = _source.next()) != END) {
_nodes.add(node);
}
_currentIndex = 0;
resetPosition();
}
return this;
|