Source code: com/tripi/asp/msxml2/DOMNamedNodeMap.java
1 /**
2 * ArrowHead ASP Server
3 * This is a source file for the ArrowHead ASP Server - an 100% Java
4 * VBScript interpreter and ASP server.
5 *
6 * For more information, see http://www.tripi.com/arrowhead
7 *
8 * Copyright (C) 2002 Terence Haddock
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 */
25 package com.tripi.asp.msxml2;
26
27 import java.util.Collection;
28 import java.util.HashMap;
29
30 import org.apache.log4j.Category;
31
32 /**
33 * This class implements msxml2.DOMNamedNodeMap.
34 *
35 * Contributed by Jim Horner <jhorner@arinbe.com>
36 */
37 public class DOMNamedNodeMap {
38
39 /** Debugging category. */
40 Category DBG = Category.getInstance(DOMNamedNodeMap.class);
41
42 private HashMap map;
43
44 public DOMNamedNodeMap () {
45 map = new HashMap();
46 }
47
48 public DOMNode getNamedItem(String name) {
49 return (DOMNode) map.get(name);
50 }
51
52 public DOMNode Item(int index) {
53 // might need to use something other than a map
54 return null;
55 }
56
57 public DOMNode SetNamedItem(DOMNode attribute) {
58
59 map.put(attribute._NodeName, attribute);
60
61 return attribute;
62 }
63
64 public int Length() {
65 return this.map.size();
66 }
67
68 // cheat method
69 public Collection Items(){
70 return map.values();
71 }
72
73 }