FileDocCategorySizeDatePackage
SingletonIterator.javaAPI DocJava SE 5 API2248Fri Aug 26 14:55:40 BST 2005com.sun.org.apache.xalan.internal.xsltc.dom

SingletonIterator

public class SingletonIterator extends DTMAxisIteratorBase
author
Jacek Ambroziak
author
Santiago Pericas-Geertsen

Fields Summary
private int
_node
private final boolean
_isConstant
Constructors Summary
public SingletonIterator()

	this(Integer.MIN_VALUE, false);
    
public SingletonIterator(int node)

	this(node, false);
    
public SingletonIterator(int node, boolean constant)

	_node = _startNode = node;
	_isConstant = constant;
    
Methods Summary
public voidgotoMark()

	_node = _markedNode;
    
public intnext()

	final int result = _node;
	_node = DTMAxisIterator.END;
	return returnNode(result);
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorreset()

	if (_isConstant) {
	    _node = _startNode;
	    return resetPosition();
	}
	else {
	    final boolean temp = _isRestartable;
	    _isRestartable = true;
	    setStartNode(_startNode);
	    _isRestartable = temp;
	}
	return this;
    
public voidsetMark()

	_markedNode = _node;
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorsetStartNode(int node)
Override the value of _node only when this object was constructed using the empty constructor.

	if (_isConstant) {
	    _node = _startNode;
	    return resetPosition();
	}
	else if (_isRestartable) {
	    if (_node <= 0)
		_node = _startNode = node;
	    return resetPosition();
	}
	return this;