/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * This one-sided test works only if the parent has been * previously tested and is known to be a descendent. It fails if * the parent is the _startNode's next sibling, or indeed any node * that follows _startNode in document order. That may suffice * for this iterator, but it's not really an isDescendent() test. * %REVIEW% rename? * * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int identity) { return (_parent(identity) >= _startNode) || (_startNode == identity); }
/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * This one-sided test works only if the parent has been * previously tested and is known to be a descendent. It fails if * the parent is the _startNode's next sibling, or indeed any node * that follows _startNode in document order. That may suffice * for this iterator, but it's not really an isDescendent() test. * %REVIEW% rename? * * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int identity) { return (_parent(identity) >= _startNode) || (_startNode == identity); }
/** * @param parm1 * */ protected int _parent( int parm1 ) { if (DEBUG) System.out.println("_parent(" + parm1 + ")"); return super._parent( parm1); }
/** * Get the next node in the iteration. * * @return The next node handle in the iteration, or END. */ public int next() { // I'm not exactly clear yet what this is doing... -sb int node; while ((node = super.next()) != END) { node = makeNodeIdentity(node); int parent = _parent(node); int child = _firstch(parent); int pos = 0; do { int type = _type(child); if (ELEMENT_NODE == type) pos++; } while ((pos < _pos) && (child = _nextsib(child)) != END); if (node == child) return node; } return (END); } } // end of NthDescendantIterator
/** * Get the next node in the iteration. * * @return The next node handle in the iteration, or END. */ public int next() { // I'm not exactly clear yet what this is doing... -sb int node; while ((node = super.next()) != END) { node = makeNodeIdentity(node); int parent = _parent(node); int child = _firstch(parent); int pos = 0; do { int type = _type(child); if (ELEMENT_NODE == type) pos++; } while ((pos < _pos) && (child = _nextsib(child)) != END); if (node == child) return node; } return (END); } } // end of NthDescendantIterator
_currentNode = _parent(node); if(NULL!=_currentNode) _currentNode = _firstch(_currentNode);
_currentNode = _parent(node); if(NULL!=_currentNode) _currentNode = _firstch(_currentNode);
/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * This one-sided test works only if the parent has been * previously tested and is known to be a descendent. It fails if * the parent is the _startNode's next sibling, or indeed any node * that follows _startNode in document order. That may suffice * for this iterator, but it's not really an isDescendent() test. * %REVIEW% rename? * * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int identity) { return (_parent(identity) >= _startNode) || (_startNode == identity); }
/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * This one-sided test works only if the parent has been * previously tested and is known to be a descendent. It fails if * the parent is the _startNode's next sibling, or indeed any node * that follows _startNode in document order. That may suffice * for this iterator, but it's not really an isDescendent() test. * %REVIEW% rename? * * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int identity) { return (_parent(identity) >= _startNode) || (_startNode == identity); }
/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * This one-sided test works only if the parent has been * previously tested and is known to be a descendent. It fails if * the parent is the _startNode's next sibling, or indeed any node * that follows _startNode in document order. That may suffice * for this iterator, but it's not really an isDescendent() test. * %REVIEW% rename? * * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int identity) { return (_parent(identity) >= _startNode) || (_startNode == identity); }
/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * This one-sided test works only if the parent has been * previously tested and is known to be a descendent. It fails if * the parent is the _startNode's next sibling, or indeed any node * that follows _startNode in document order. That may suffice * for this iterator, but it's not really an isDescendent() test. * %REVIEW% rename? * * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int identity) { return (_parent(identity) >= _startNode) || (_startNode == identity); }
/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * This one-sided test works only if the parent has been * previously tested and is known to be a descendent. It fails if * the parent is the _startNode's next sibling, or indeed any node * that follows _startNode in document order. That may suffice * for this iterator, but it's not really an isDescendent() test. * %REVIEW% rename? * * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int identity) { return (_parent(identity) >= _startNode) || (_startNode == identity); }
/** * Tell if this node identity is a descendant. Assumes that * the node info for the element has already been obtained. * * This one-sided test works only if the parent has been * previously tested and is known to be a descendent. It fails if * the parent is the _startNode's next sibling, or indeed any node * that follows _startNode in document order. That may suffice * for this iterator, but it's not really an isDescendent() test. * %REVIEW% rename? * * @param identity The index number of the node in question. * @return true if the index is a descendant of _startNode. */ protected boolean isDescendant(int identity) { return (_parent(identity) >= _startNode) || (_startNode == identity); }
/** * @param parm1 * */ protected int _parent( int parm1 ) { if (DEBUG) System.out.println("_parent(" + parm1 + ")"); return super._parent( parm1); }