aboutsummaryrefslogtreecommitdiff
path: root/common/src/at/gv/egovernment/moa/util/NodeListAdapter.java
diff options
context:
space:
mode:
authorgregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-07-07 10:58:37 +0000
committergregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-07-07 10:58:37 +0000
commitece7d18cf35374bf4e26d041799cda8f791c89f8 (patch)
tree33707cb77627b65a2a4e7327a2e93fb7751c1b76 /common/src/at/gv/egovernment/moa/util/NodeListAdapter.java
parent273aed93c03b18a6c6bb1af745ae46a13ad3c7f2 (diff)
downloadmoa-id-spss-ece7d18cf35374bf4e26d041799cda8f791c89f8.tar.gz
moa-id-spss-ece7d18cf35374bf4e26d041799cda8f791c89f8.tar.bz2
moa-id-spss-ece7d18cf35374bf4e26d041799cda8f791c89f8.zip
Initial commit
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@2 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'common/src/at/gv/egovernment/moa/util/NodeListAdapter.java')
-rw-r--r--common/src/at/gv/egovernment/moa/util/NodeListAdapter.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/common/src/at/gv/egovernment/moa/util/NodeListAdapter.java b/common/src/at/gv/egovernment/moa/util/NodeListAdapter.java
new file mode 100644
index 000000000..7102cadca
--- /dev/null
+++ b/common/src/at/gv/egovernment/moa/util/NodeListAdapter.java
@@ -0,0 +1,44 @@
+package at.gv.egovernment.moa.util;
+
+import java.util.List;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * A <code>NodeList</code> implementation based on a <code>List</code>.
+ *
+ * @see java.util.List
+ * @see org.w3c.dom.NodeList
+ *
+ * @author Patrick Peck
+ * @version $Id$
+ */
+public class NodeListAdapter implements NodeList {
+ /** The <code>List</code> to wrap. */
+ private List nodeList;
+
+ /**
+ * Create a new <code>NodeListAdapter</code>.
+ *
+ * @param nodeList The <code>List</code> containing the nodes.
+ */
+ public NodeListAdapter(List nodeList) {
+ this.nodeList = nodeList;
+ }
+
+ /**
+ * @see org.w3c.dom.NodeList#item(int)
+ */
+ public Node item(int index) {
+ return (Node) nodeList.get(index);
+ }
+
+ /**
+ * @see org.w3c.dom.NodeList#getLength()
+ */
+ public int getLength() {
+ return nodeList.size();
+ }
+
+}