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

AnyNodeCounter

public abstract class AnyNodeCounter extends NodeCounter
author
Jacek Ambroziak
author
Santiago Pericas-Geertsen

Fields Summary
Constructors Summary
public AnyNodeCounter(Translet translet, DOM document, DTMAxisIterator iterator)

	super(translet, document, iterator);
    
Methods Summary
public java.lang.StringgetCounter()

	int result;
	if (_value != Integer.MIN_VALUE) {
	    result = _value;
	}
	else {
	    int next = _node; 
            final int root = _document.getDocument();
	    result = 0;
	    while (next >= root && !matchesFrom(next)) {
		if (matchesCount(next)) {
		    ++result;	
		}
		next--;
//%HZ%:  Is this the best way of finding the root?  Is it better to check
//%HZ%:  parent(next)?
		/*
		if (next == root) {
		    break;
                }
		else {
		    --next;		
                }
                */
	    }
	}
	return formatNumbers(result);
    
public static com.sun.org.apache.xalan.internal.xsltc.dom.NodeCountergetDefaultNodeCounter(com.sun.org.apache.xalan.internal.xsltc.Translet translet, com.sun.org.apache.xalan.internal.xsltc.DOM document, com.sun.org.apache.xml.internal.dtm.DTMAxisIterator iterator)

	return new DefaultAnyNodeCounter(translet, document, iterator);
    
public com.sun.org.apache.xalan.internal.xsltc.dom.NodeCountersetStartNode(int node)

	_node = node;
	_nodeType = _document.getExpandedTypeID(node);
	return this;