1 package org.jdbc4olap.xmla;
2
3 import java.util.ArrayList;
4
5 import org.w3c.dom.Node;
6 import org.w3c.dom.NodeList;
7
8 public class XmlaNodeList implements NodeList {
9
10 private ArrayList<Node> list;
11
12 public int getLength() {
13 return list.size();
14 }
15
16 public Node item(int index) {
17 return list.get(index);
18 }
19
20 public XmlaNodeList() {
21 list = new ArrayList<Node>();
22 }
23
24 public boolean add(Node node) {
25 return list.add(node);
26 }
27
28 public boolean addAll(NodeList nodeList) {
29 for (int i = 0; i < nodeList.getLength(); i++) {
30 list.add(nodeList.item(i));
31 }
32 return nodeList.getLength() > 0;
33 }
34
35 }