KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > w3c > dom > html2 > HTMLOptionsCollection


1 /*
2     GNU LESSER GENERAL PUBLIC LICENSE
3     Copyright (C) 2006 The Lobo Project
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Lesser General Public
7     License as published by the Free Software Foundation; either
8     version 2.1 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13     Lesser General Public License for more details.
14
15     You should have received a copy of the GNU Lesser General Public
16     License along with this library; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19     Contact info: xamjadmin@users.sourceforge.net
20 */

21 /*
22  * Copyright (c) 2003 World Wide Web Consortium,
23  * (Massachusetts Institute of Technology, Institut National de
24  * Recherche en Informatique et en Automatique, Keio University). All
25  * Rights Reserved. This program is distributed under the W3C's Software
26  * Intellectual Property License. This program is distributed in the
27  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
28  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29  * PURPOSE.
30  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
31  */

32
33 package org.w3c.dom.html2;
34
35 import org.w3c.dom.Node JavaDoc;
36 import org.w3c.dom.DOMException JavaDoc;
37
38 /**
39  * An <code>HTMLOptionsCollection</code> is a list of nodes representing HTML
40  * option element. An individual node may be accessed by either ordinal
41  * index or the node's <code>name</code> or <code>id</code> attributes.
42  * Collections in the HTML DOM are assumed to be live meaning that they are
43  * automatically updated when the underlying document is changed.
44  * <p>See also the <a HREF='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
45  * @since DOM Level 2
46  */

47 public interface HTMLOptionsCollection {
48     /**
49      * This attribute specifies the length or size of the list.
50      */

51     public int getLength();
52     /**
53      * This attribute specifies the length or size of the list.
54      * @exception DOMException
55      * NOT_SUPPORTED_ERR: if setting the length is not allowed by the
56      * implementation.
57      */

58     public void setLength(int length)
59                           throws DOMException JavaDoc;
60
61     /**
62      * This method retrieves a node specified by ordinal index. Nodes are
63      * numbered in tree order (depth-first traversal order).
64      * @param index The index of the node to be fetched. The index origin is
65      * 0.
66      * @return The <code>Node</code> at the corresponding position upon
67      * success. A value of <code>null</code> is returned if the index is
68      * out of range.
69      */

70     public Node JavaDoc item(int index);
71
72     /**
73      * This method retrieves a <code>Node</code> using a name. It first
74      * searches for a <code>Node</code> with a matching <code>id</code>
75      * attribute. If it doesn't find one, it then searches for a
76      * <code>Node</code> with a matching <code>name</code> attribute, but
77      * only on those elements that are allowed a name attribute. This method
78      * is case insensitive in HTML documents and case sensitive in XHTML
79      * documents.
80      * @param name The name of the <code>Node</code> to be fetched.
81      * @return The <code>Node</code> with a <code>name</code> or
82      * <code>id</code> attribute whose value corresponds to the specified
83      * string. Upon failure (e.g., no node with this name exists), returns
84      * <code>null</code>.
85      */

86     public Node JavaDoc namedItem(String JavaDoc name);
87
88 }
89
Popular Tags