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