Code example for NodeList

Methods: getLength, item

0
        return new Iterator<Node>() {
            private int index = 0;
 
            /** {@inheritDoc} */ 
            public boolean hasNext() { 
                return index < nodeList.getLength();
            } 
 
            /** {@inheritDoc} */ 
            public Node next() {
                if (!hasNext()) { 
                    throw new NoSuchElementException();
                } 
                return nodeList.item(index++);
            } 
 
            /** {@inheritDoc} */ 
            public void remove() { 
                throw new UnsupportedOperationException();
            } 
        };