KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > dom > DOMImplementationListImpl


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package com.sun.org.apache.xerces.internal.dom;
18
19 import java.util.Vector JavaDoc;
20 import org.w3c.dom.DOMImplementationList JavaDoc;
21 import org.w3c.dom.DOMImplementation JavaDoc;
22
23 /**
24  * <p>This class implements the DOM Level 3 Core interface DOMImplementationList.</p>
25  *
26  * @author Neil Delima, IBM
27  * @since DOM Level 3 Core
28  */

29 public class DOMImplementationListImpl implements DOMImplementationList JavaDoc {
30
31     //A collection of DOMImplementations
32
private Vector JavaDoc fImplementations;
33
34     /**
35      * Construct an empty list of DOMImplementations
36      */

37     public DOMImplementationListImpl() {
38         fImplementations = new Vector JavaDoc();
39     }
40
41     /**
42      * Construct an empty list of DOMImplementations
43      */

44     public DOMImplementationListImpl(Vector JavaDoc params) {
45         fImplementations = params;
46     }
47
48     /**
49      * Returns the indexth item in the collection.
50      *
51      * @param index The index of the DOMImplemetation from the list to return.
52      */

53     public DOMImplementation JavaDoc item(int index) {
54         try {
55             return (DOMImplementation JavaDoc) fImplementations.elementAt(index);
56         } catch (ArrayIndexOutOfBoundsException JavaDoc e) {
57             return null;
58         }
59     }
60     
61     /**
62      * Returns the number of DOMImplementations in the list.
63      *
64      * @return An integer indicating the number of DOMImplementations.
65      */

66     public int getLength() {
67         return fImplementations.size();
68     }
69 }
70
Popular Tags