1 /* |
1 /* |
2 * reserved comment block |
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT REMOVE OR ALTER! |
3 * @LastModified: Oct 2017 |
4 */ |
4 */ |
5 /* |
5 /* |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
7 * contributor license agreements. See the NOTICE file distributed with |
7 * contributor license agreements. See the NOTICE file distributed with |
8 * this work for additional information regarding copyright ownership. |
8 * this work for additional information regarding copyright ownership. |
19 * limitations under the License. |
19 * limitations under the License. |
20 */ |
20 */ |
21 |
21 |
22 package com.sun.org.apache.xerces.internal.dom; |
22 package com.sun.org.apache.xerces.internal.dom; |
23 |
23 |
24 import java.util.Vector; |
24 import java.util.ArrayList; |
|
25 import java.util.List; |
|
26 import org.w3c.dom.DOMImplementation; |
25 import org.w3c.dom.DOMImplementationList; |
27 import org.w3c.dom.DOMImplementationList; |
26 import org.w3c.dom.DOMImplementation; |
|
27 |
28 |
28 /** |
29 /** |
29 * <p>This class implements the DOM Level 3 Core interface DOMImplementationList.</p> |
30 * <p>This class implements the DOM Level 3 Core interface DOMImplementationList.</p> |
30 * |
31 * |
31 * @xerces.internal |
32 * @xerces.internal |
34 * @since DOM Level 3 Core |
35 * @since DOM Level 3 Core |
35 */ |
36 */ |
36 public class DOMImplementationListImpl implements DOMImplementationList { |
37 public class DOMImplementationListImpl implements DOMImplementationList { |
37 |
38 |
38 //A collection of DOMImplementations |
39 //A collection of DOMImplementations |
39 private Vector fImplementations; |
40 private List<DOMImplementation> fImplementations; |
40 |
41 |
41 /** |
42 /** |
42 * Construct an empty list of DOMImplementations |
43 * Construct an empty list of DOMImplementations |
43 */ |
44 */ |
44 public DOMImplementationListImpl() { |
45 public DOMImplementationListImpl() { |
45 fImplementations = new Vector(); |
46 fImplementations = new ArrayList<>(); |
46 } |
47 } |
47 |
48 |
48 /** |
49 /** |
49 * Construct an empty list of DOMImplementations |
50 * Construct an empty list of DOMImplementations |
50 */ |
51 */ |
51 public DOMImplementationListImpl(Vector params) { |
52 public DOMImplementationListImpl(List<DOMImplementation> params) { |
52 fImplementations = params; |
53 fImplementations = params; |
53 } |
54 } |
54 |
55 |
55 /** |
56 /** |
56 * Returns the indexth item in the collection. |
57 * Returns the indexth item in the collection. |
57 * |
58 * |
58 * @param index The index of the DOMImplemetation from the list to return. |
59 * @param index The index of the DOMImplemetation from the list to return. |
59 */ |
60 */ |
60 public DOMImplementation item(int index) { |
61 public DOMImplementation item(int index) { |
61 try { |
62 try { |
62 return (DOMImplementation) fImplementations.elementAt(index); |
63 return fImplementations.get(index); |
63 } catch (ArrayIndexOutOfBoundsException e) { |
64 } catch (IndexOutOfBoundsException e) { |
64 return null; |
65 return null; |
65 } |
66 } |
66 } |
67 } |
67 |
68 |
68 /** |
69 /** |