01: // You can redistribute this software and/or modify it under the terms of
02: // the Infozone Software License version 2 published by the Infozone Group
03: // (http://www.infozone-group.org).
04: //
05: // Copyright (C) @year@ by The Infozone Group. All rights reserved.
06: //
07: // $Id: NodeListImpl.java,v 1.1 2002/05/10 08:59:12 per_nyfelt Exp $
08:
09: package org.infozone.tools.xml.queries.xt;
10:
11: import org.w3c.dom.*;
12: import java.io.*;
13: import java.util.*;
14:
15: /**
16: * @version $Revision: 1.1 $ $Date: 2002/05/10 08:59:12 $
17: * @author <a href="http://www.softwarebuero.de">SMB</a>
18: */
19: public final class NodeListImpl implements NodeList, Serializable {
20:
21: final static long serialVersionUID = 1;
22:
23: private Vector _nodes;
24:
25: public NodeListImpl(Enumeration e) {
26: _nodes = new Vector();
27: while (e.hasMoreElements()) {
28: _nodes.addElement((Node) e.nextElement());
29: }
30: }
31:
32: public Node item(int index) {
33: return index >= 0 && index < _nodes.size() ? (Node) _nodes
34: .elementAt(index) : null;
35: }
36:
37: public int getLength() {
38: return _nodes.size();
39: }
40:
41: }
|