KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > 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 org.apache.xerces.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  * @xerces.internal
27  *
28  * @author Neil Delima, IBM
29  * @since DOM Level 3 Core
30  */

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

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

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

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

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