KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > w3c > tidy > DOMAttrMapImpl


1 /*
2  * @(#)DOMAttrMapImpl.java 1.11 2000/08/16
3  *
4  */

5
6 package org.w3c.tidy;
7
8 import org.w3c.dom.DOMException JavaDoc;
9
10 /**
11  *
12  * DOMAttrMapImpl
13  *
14  * (c) 1998-2000 (W3C) MIT, INRIA, Keio University
15  * See Tidy.java for the copyright notice.
16  * Derived from <a HREF="http://www.w3.org/People/Raggett/tidy">
17  * HTML Tidy Release 4 Aug 2000</a>
18  *
19  * @author Dave Raggett <dsr@w3.org>
20  * @author Andy Quick <ac.quick@sympatico.ca> (translation to Java)
21  * @version 1.4, 1999/09/04 DOM support
22  * @version 1.5, 1999/10/23 Tidy Release 27 Sep 1999
23  * @version 1.6, 1999/11/01 Tidy Release 22 Oct 1999
24  * @version 1.7, 1999/12/06 Tidy Release 30 Nov 1999
25  * @version 1.8, 2000/01/22 Tidy Release 13 Jan 2000
26  * @version 1.9, 2000/06/03 Tidy Release 30 Apr 2000
27  * @version 1.10, 2000/07/22 Tidy Release 8 Jul 2000
28  * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000
29  */

30
31 public class DOMAttrMapImpl implements org.w3c.dom.NamedNodeMap JavaDoc {
32
33     private AttVal first = null;
34
35     protected DOMAttrMapImpl(AttVal first)
36     {
37         this.first = first;
38     }
39
40     /**
41      * @see org.w3c.dom.NamedNodeMap#getNamedItem
42      */

43     public org.w3c.dom.Node JavaDoc getNamedItem(String JavaDoc name)
44     {
45         AttVal att = this.first;
46         while (att != null) {
47             if (att.attribute.equals(name)) break;
48             att = att.next;
49         }
50         if (att != null)
51             return att.getAdapter();
52         else
53             return null;
54     }
55
56     /**
57      * @see org.w3c.dom.NamedNodeMap#setNamedItem
58      */

59     public org.w3c.dom.Node JavaDoc setNamedItem(org.w3c.dom.Node JavaDoc arg)
60                                              throws DOMException JavaDoc
61     {
62         // NOT SUPPORTED
63
return null;
64     }
65
66     /**
67      * @see org.w3c.dom.NamedNodeMap#removeNamedItem
68      */

69     public org.w3c.dom.Node JavaDoc removeNamedItem(String JavaDoc name)
70                                                 throws DOMException JavaDoc
71     {
72         // NOT SUPPORTED
73
return null;
74     }
75
76     /**
77      * @see org.w3c.dom.NamedNodeMap#item
78      */

79     public org.w3c.dom.Node JavaDoc item(int index)
80     {
81         int i = 0;
82         AttVal att = this.first;
83         while (att != null) {
84             if (i >= index) break;
85             i++;
86             att = att.next;
87         }
88         if (att != null)
89             return att.getAdapter();
90         else
91             return null;
92     }
93
94     /**
95      * @see org.w3c.dom.NamedNodeMap#getLength
96      */

97     public int getLength()
98     {
99         int len = 0;
100         AttVal att = this.first;
101         while (att != null) {
102             len++;
103             att = att.next;
104         }
105         return len;
106     }
107
108     /**
109      * DOM2 - not implemented.
110      */

111     public org.w3c.dom.Node JavaDoc getNamedItemNS(String JavaDoc namespaceURI,
112                                            String JavaDoc localName)
113     {
114     return null;
115     }
116
117     /**
118      * DOM2 - not implemented.
119      * @exception org.w3c.dom.DOMException
120      */

121     public org.w3c.dom.Node JavaDoc setNamedItemNS(org.w3c.dom.Node JavaDoc arg)
122         throws org.w3c.dom.DOMException JavaDoc
123     {
124     return null;
125     }
126
127     /**
128      * DOM2 - not implemented.
129      * @exception org.w3c.dom.DOMException
130      */

131     public org.w3c.dom.Node JavaDoc removeNamedItemNS(String JavaDoc namespaceURI,
132                                               String JavaDoc localName)
133         throws org.w3c.dom.DOMException JavaDoc
134     {
135     return null;
136     }
137
138 }
139
Popular Tags