FileDocCategorySizeDatePackage
AbsoluteIterator.javaAPI DocJava SE 5 API2923Fri Aug 26 14:55:38 BST 2005com.sun.org.apache.xalan.internal.xsltc.dom

AbsoluteIterator

public final class AbsoluteIterator extends DTMAxisIteratorBase
Absolute iterators ignore the node that is passed to setStartNode(). Instead, they always start from the root node. The node passed to setStartNode() is not totally useless, though. It is needed to obtain the DOM mask, i.e. the index into the MultiDOM table that corresponds to the DOM "owning" the node. The DOM mask is cached, so successive calls to setStartNode() passing nodes from other DOMs will have no effect (i.e. this iterator cannot migrate between DOMs).
author
Jacek Ambroziak
author
Santiago Pericas-Geertsen

Fields Summary
private DTMAxisIterator
_source
Source for this iterator.
Constructors Summary
public AbsoluteIterator(DTMAxisIterator source)

	_source = source;
// System.out.println("AI source = " + source + " this = " + this);
    
Methods Summary
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorcloneIterator()

	try {
	    final AbsoluteIterator clone = (AbsoluteIterator) super.clone();
	    clone._source = _source.cloneIterator();	// resets source
	    clone.resetPosition();
	    clone._isRestartable = false;
	    return clone;
	}
	catch (CloneNotSupportedException e) {
	    BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
				      e.toString());
	    return null;
	}
    
public voidgotoMark()

	_source.gotoMark();
    
public intnext()

	return returnNode(_source.next());
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorreset()

	_source.reset();
	return resetPosition();
    
public voidsetMark()

	_source.setMark();
    
public voidsetRestartable(boolean isRestartable)

	_isRestartable = isRestartable;
	_source.setRestartable(isRestartable);
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorsetStartNode(int node)

	_startNode = DTMDefaultBase.ROOTNODE;
	if (_isRestartable) {
	    _source.setStartNode(_startNode);
	    resetPosition();
	}
	return this;