KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > uddi4j > VectorNodeList


1 /*
2  * The source code contained herein is licensed under the IBM Public License
3  * Version 1.0, which has been approved by the Open Source Initiative.
4  * Copyright (C) 2001, International Business Machines Corporation
5  * All Rights Reserved.
6  *
7  */

8
9 package org.uddi4j;
10
11 import java.util.Vector JavaDoc;
12
13 import org.w3c.dom.Node JavaDoc;
14
15 public class VectorNodeList implements org.w3c.dom.NodeList JavaDoc {
16     private Vector JavaDoc v = null;
17
18     public VectorNodeList(Vector JavaDoc v) {
19         this.v = v;
20     }
21
22     public Vector JavaDoc getVector() {
23         return v;
24     }
25     /**
26      * Returns the <code>index</code>th item in the collection. If
27      * <code>index</code> is greater than or equal to the number of nodes in
28      * the list, this returns <code>null</code>.
29      * @param index Index item into the collection.
30      * @return The node at the <code>index</code>th position in the
31      * <code>NodeList</code>, or <code>null</code>, if that index is not a
32      * valid.
33      */

34     public Node JavaDoc item(int index) {
35         return (Node JavaDoc)v.elementAt(index);
36     }
37     /**
38      * The number of nodes in the list. The range of valid child node indices is
39      * 0 to <code>length-1</code>, inclusive.
40      */

41     public int getLength() {
42         return v.size();
43     }
44 }
45
Popular Tags