/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { int count=0; for (int handle=m_firstChild; handle!=DTM.NULL; handle=m_parentDTM.getNextSibling(handle)) { ++count; } return count; } }
/** * The number of nodes in the list. The range of valid child node indices * is 0 to <code>length-1</code> inclusive. */ public int getLength() { int count=0; for (int handle=m_firstChild; handle!=DTM.NULL; handle=m_parentDTM.getNextSibling(handle)) { ++count; } return count; } }
/** * Returns the <code>index</code>th item in the collection. If * <code>index</code> is greater than or equal to the number of nodes in * the list, this returns <code>null</code>. * @param index Index into the collection. * @return The node at the <code>index</code>th position in the * <code>NodeList</code>, or <code>null</code> if that is not a valid * index. */ public Node item(int index) { int handle=m_firstChild; while(--index>=0 && handle!=DTM.NULL) { handle=m_parentDTM.getNextSibling(handle); } if (handle == DTM.NULL) { return null; } return m_parentDTM.getNode(handle); }
/** * Returns the <code>index</code>th item in the collection. If * <code>index</code> is greater than or equal to the number of nodes in * the list, this returns <code>null</code>. * @param index Index into the collection. * @return The node at the <code>index</code>th position in the * <code>NodeList</code>, or <code>null</code> if that is not a valid * index. */ public Node item(int index) { int handle=m_firstChild; while(--index>=0 && handle!=DTM.NULL) { handle=m_parentDTM.getNextSibling(handle); } if (handle == DTM.NULL) { return null; } return m_parentDTM.getNode(handle); }
/** * Returns the next node in the set and advances the position of the * iterator in the set. After a NodeIterator is created, the first call * to nextNode() returns the first node in the set. * * @return The next <code>Node</code> in the set being iterated over, or * <code>null</code> if there are no more members in that set. */ public int nextNode() { if(m_foundLast) return DTM.NULL; int next; m_lastFetched = next = (DTM.NULL == m_lastFetched) ? m_cdtm.getFirstChild(m_context) : m_cdtm.getNextSibling(m_lastFetched); // m_lastFetched = next; if (DTM.NULL != next) { m_pos++; return next; } else { m_foundLast = true; return DTM.NULL; } }
/** * Returns the next node in the set and advances the position of the * iterator in the set. After a NodeIterator is created, the first call * to nextNode() returns the first node in the set. * * @return The next <code>Node</code> in the set being iterated over, or * <code>null</code> if there are no more members in that set. */ public int nextNode() { if(m_foundLast) return DTM.NULL; int next; m_lastFetched = next = (DTM.NULL == m_lastFetched) ? m_cdtm.getFirstChild(m_context) : m_cdtm.getNextSibling(m_lastFetched); // m_lastFetched = next; if (DTM.NULL != next) { m_pos++; return next; } else { m_foundLast = true; return DTM.NULL; } }
/** * * * @see org.w3c.dom.Node */ public final Node getNextSibling() { // Attr's Next is defined at DTM level, but not at DOM level. if (dtm.getNodeType(node) == Node.ATTRIBUTE_NODE) return null; int newnode = dtm.getNextSibling(node); return (newnode == DTM.NULL) ? null : dtm.getNode(newnode); }
/** * * * @see org.w3c.dom.Node */ public final Node getNextSibling() { // Attr's Next is defined at DTM level, but not at DOM level. if (dtm.getNodeType(node) == Node.ATTRIBUTE_NODE) return null; int newnode = dtm.getNextSibling(node); return (newnode == DTM.NULL) ? null : dtm.getNode(newnode); }
break; nextNode = m_dtm.getNextSibling(pos);
break; nextNode = m_dtm.getNextSibling(pos);
break; nextNode = m_dtm.getNextSibling(pos);
break; nextNode = m_dtm.getNextSibling(pos);
for(int kidhandle=dtm.getFirstChild(dochandle); kidhandle!=DTM.NULL; kidhandle=dtm.getNextSibling(kidhandle))
for(int kidhandle=dtm.getFirstChild(dochandle); kidhandle!=DTM.NULL; kidhandle=dtm.getNextSibling(kidhandle))
n = dtm.getNextSibling(n))
n = dtm.getNextSibling(n))
child = dtm.getNextSibling(child))
child = dtm.getNextSibling(child))
break; nextNode = dtm.getNextSibling(pos);
/** * * * @see org.w3c.dom.Node */ public final Node getNextSibling() { // Attr's Next is defined at DTM level, but not at DOM level. if (dtm.getNodeType(node) == Node.ATTRIBUTE_NODE) return null; int newnode = dtm.getNextSibling(node); return (newnode == DTM.NULL) ? null : dtm.getNode(newnode); }