예제 #1
0
 @Override
 public void remove() {
   if (index == 0) {
     throw new IllegalStateException();
   }
   index--;
   parent.removeChild(children.item(index));
   size = children.getLength();
 }
예제 #2
0
 @Override
 public Element next() {
   if (!hasNext()) {
     throw new NoSuchElementException();
   }
   Element child = (Element) children.item(index);
   index++;
   return child;
 }
예제 #3
0
 public ChildrenIterator(final Element parent) {
   this.parent = parent;
   this.children = parent.getChildren();
   this.size = children.getLength();
   this.index = 0;
 }