1 19 20 package com.hp.hpl.jena.util.xml; 23 24 25 import java.util.*; 28 29 import org.w3c.dom.NodeList ; 30 31 32 40 public class NodeListIterator 41 implements Iterator 42 { 43 44 47 50 53 54 protected NodeList m_nodeList; 55 56 57 protected int m_index = 0; 58 59 60 63 public NodeListIterator( NodeList nodeList ) { 64 m_nodeList = nodeList; 65 } 66 67 68 71 74 public void remove() { 75 throw new UnsupportedOperationException ( "Cannot remove() from a DOM nodelist" ); 76 } 77 78 81 public boolean hasNext() { 82 return m_index < m_nodeList.getLength(); 83 } 84 85 88 public Object next() { 89 return m_nodeList.item( m_index++ ); 90 } 91 92 93 96 100 } 101 102 103 129 | Popular Tags |