Пример #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;
 }