/** * Get the next node in the iteration. * * @return The next node handle in the iteration, or END. */ public int next() { if (_currentNode != DTM.NULL) { for (int node = (NOTPROCESSED == _currentNode) ? _firstch(makeNodeIdentity(_startNode)) : _nextsib(_currentNode); node != END; node = _nextsib(node)) { if (m_expandedNameTable.getNamespaceID(_exptype(node)) == _nsType) { _currentNode = node; return returnNode(node); } } } return END; } } // end of NamespaceChildrenIterator
node = getDocument(); m_realStartNode = node; int nodeID = makeNodeIdentity(node); nodeID = _parent(nodeID); node = makeNodeHandle(nodeID); nodeID = _parent(nodeID); node = makeNodeHandle(nodeID);
/** * 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() { _currentNode = (_currentNode == DTM.NULL) ? DTM.NULL : _nextsib(_currentNode); return returnNode(makeNodeHandle(_currentNode)); } } // end of FollowingSiblingIterator
/** * Get the next node in the iteration. * * @return The next node handle in the iteration, or END. */ public int next() { int node; for (node = _currentNode; node != END; node = getNextNamespaceNode(_startNode, node, true)) { if (getExpandedTypeID(node) == _nodeType || getNodeType(node) == _nodeType || getNamespaceType(node) == _nodeType) { _currentNode = node; return returnNode(node); } } return (_currentNode =END); } } // end of TypedNamespaceIterator
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */ public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) node = getDocument(); if (_isRestartable) { _startNode = node; _currentNode = getFirstAttributeIdentity(makeNodeIdentity(node)); return resetPosition(); } return this; }
node = getDocument(); if (_isRestartable) node = _startNodeID = makeNodeIdentity(node); int type = m_expandedNameTable.getType(_exptype(node)); if(ExpandedNameTable.ATTRIBUTE == type || ExpandedNameTable.NAMESPACE == type ) _currentNode = _parent(node); if(NULL!=_currentNode) _currentNode = _firstch(_currentNode); else _currentNode = node;
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */ public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) node = getDocument(); if (_isRestartable) { _startNode = node; _currentNode = (node == DTM.NULL) ? DTM.NULL : _firstch(makeNodeIdentity(_startNode)); return resetPosition(); } return this; }
node = getDocument(); if (_isRestartable) node = makeNodeIdentity(node); if (_type(node) == DTM.ATTRIBUTE_NODE) node = _parent(node); while ((parent = _parent(parent)) != NULL)
/** * Get the next node in the iteration. In this case, we return * only the immediate parent, _if_ it matches the requested nodeType. * * @return The next node handle in the iteration, or END. */ public int next() { int result = _currentNode; if (_nodeType >= DTM.NTYPES) { if (_nodeType != getExpandedTypeID(_currentNode)) { result = END; } } else if (_nodeType != NULL) { if (_nodeType != getNodeType(_currentNode)) { result = END; } } _currentNode = END; return returnNode(result); } } // end of ParentIterator
/** * Get the next node in the iteration. * * @return The next node handle in the iteration, or END. */ public int next() { // Bugzilla 8324: We were forgetting to skip Attrs and NS nodes. // Also recoded the loop controls for clarity and to flatten out // the tail-recursion. for(++_currentNode; _sp>=0; ++_currentNode) { if(_currentNode < _stack[_sp]) { if(_type(_currentNode) != ATTRIBUTE_NODE && _type(_currentNode) != NAMESPACE_NODE) return returnNode(makeNodeHandle(_currentNode)); } else --_sp; } return NULL; }
/** * Get the next node in the iteration. * * @return The next node handle in the iteration, or END. */ public int next() { int node; int type; if (_startNode == NULL) { return NULL; } node = _currentNode; do { node++; type = _type(node); if (NULL == type ||!isDescendant(node)) { _currentNode = NULL; return END; } } while (type != _nodeType && _exptype(node) != _nodeType); _currentNode = node; return returnNode(makeNodeHandle(node)); } } // end of TypedDescendantIterator
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */ public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) node = getDocument(); if (_isRestartable) { _startNode = node; _currentNode = makeNodeIdentity(node); return resetPosition(); } return this; }
public FollowingIterator() { m_traverser = getAxisTraverser(Axis.FOLLOWING); }
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */ public DTMAxisIterator setStartNode(int node) { if (_isRestartable) { _startNode = getDocumentRoot(node); _currentNode = NULL; return resetPosition(); } return this; }
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */ public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) node = getDocument(); if (_isRestartable) { _startNode = node; _currentNode = getFirstNamespaceNode(node, false); return resetPosition(); } return this; }
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */ public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) node = getDocument(); if (_isRestartable) { _startNode = node; _currentNode = getParent(node); return resetPosition(); } return this; }
/** * @param parm1 * */ public int getExpandedTypeID( int parm1 ) { if (DEBUG) System.out.println("getExpandedTypeID("+parm1+")"); return super.getExpandedTypeID( parm1); }
/** * 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); }