source: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/MyNodeList.java@ 25635

Last change on this file since 25635 was 25635, checked in by sjm84, 12 years ago

Fixing Greenstone 3's use (or lack thereof) of generics, this was done automatically so we may want to change it over time. This change will also auto-format any files that have not already been formatted.

  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1/*
2 * MyNodeList.java
3 *
4
5 * Copyright (C) 2005 New Zealand Digital Library, http://www.nzdl.org
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21package org.greenstone.gsdl3.util;
22
23import org.w3c.dom.Node;
24import org.w3c.dom.NodeList;
25
26import java.util.ArrayList;
27
28public class MyNodeList implements NodeList {
29 private ArrayList<Node> node_list = null;
30
31 public MyNodeList() {
32 node_list = new ArrayList<Node>();
33 }
34 public int getLength() {
35 return node_list.size();
36 }
37
38 public Node item(int i) {
39 if (i<0 || i >= node_list.size()) return null;
40 return node_list.get(i);
41 }
42
43 public void addNode(Node n) {
44 node_list.add(n);
45 }
46}
Note: See TracBrowser for help on using the repository browser.