1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.ws.commons.schema;
18
19 import java.util.Iterator;
20 import java.util.Vector;
21
22
23
24
25
26 public class XmlSchemaObjectCollection {
27
28 Vector objects;
29
30
31
32
33 public XmlSchemaObjectCollection() {
34 objects = new Vector();
35 }
36
37 public int getCount() {
38 return objects.size();
39 }
40
41 public XmlSchemaObject getItem(int i) {
42 return (XmlSchemaObject) objects.elementAt(i);
43 }
44
45 public void setItem(int i, XmlSchemaObject item) {
46 objects.insertElementAt(item, i);
47 }
48
49 public void add(XmlSchemaObject item) {
50 objects.addElement(item);
51 }
52
53 public boolean contains(XmlSchemaObject item) {
54 return objects.contains(item);
55 }
56
57 public int indexOf(XmlSchemaObject item) {
58 return objects.indexOf(item);
59 }
60
61 public void remove(XmlSchemaObject item) {
62 objects.remove(item);
63 }
64
65 public void removeAt(int index) {
66 objects.removeElementAt(index);
67 }
68
69 public Iterator getIterator() {
70 return objects.iterator();
71 }
72
73 public String toString(String prefix, int tab) {
74 String xml = new String();
75
76 for (int i = 0; i < getCount(); i++) {
77 xml += getItem(i).toString(prefix, tab);
78 }
79
80
81 return xml;
82
83 }
84 }