32 lines
705 B
Java
32 lines
705 B
Java
package configuration;
|
|
|
|
import org.w3c.dom.Element;
|
|
import org.w3c.dom.NodeList;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.Spliterator;
|
|
import java.util.function.Consumer;
|
|
|
|
public class IterableElementList implements Iterable<Element> {
|
|
private final NodeList nodes;
|
|
|
|
public IterableElementList(NodeList nodes) {
|
|
this.nodes = nodes;
|
|
}
|
|
|
|
@Override
|
|
public Iterator<Element> iterator() {
|
|
return new ElementListIterator(nodes);
|
|
}
|
|
|
|
@Override
|
|
public void forEach(Consumer<? super Element> action) {
|
|
Iterable.super.forEach(action);
|
|
}
|
|
|
|
@Override
|
|
public Spliterator<Element> spliterator() {
|
|
return Iterable.super.spliterator();
|
|
}
|
|
}
|