1
2
3
4
5
6
7
8 package org.exolab.castor.builder.binding.xml;
9
10
11
12
13
14
15 public class Forces implements java.io.Serializable {
16
17
18
19
20
21
22
23
24
25 private java.util.List _forceList;
26
27
28
29
30
31
32 public Forces() {
33 super();
34 this._forceList = new java.util.ArrayList();
35 }
36
37
38
39
40
41
42
43
44
45
46
47
48
49 public void addForce(
50 final java.lang.String vForce)
51 throws java.lang.IndexOutOfBoundsException {
52 this._forceList.add(vForce);
53 }
54
55
56
57
58
59
60
61
62
63 public void addForce(
64 final int index,
65 final java.lang.String vForce)
66 throws java.lang.IndexOutOfBoundsException {
67 this._forceList.add(index, vForce);
68 }
69
70
71
72
73
74
75
76 public java.util.Enumeration enumerateForce(
77 ) {
78 return java.util.Collections.enumeration(this._forceList);
79 }
80
81
82
83
84
85
86
87
88
89 public java.lang.String getForce(
90 final int index)
91 throws java.lang.IndexOutOfBoundsException {
92
93 if (index < 0 || index >= this._forceList.size()) {
94 throw new IndexOutOfBoundsException("getForce: Index value '" + index + "' not in range [0.." + (this._forceList.size() - 1) + "]");
95 }
96
97 return (java.lang.String) _forceList.get(index);
98 }
99
100
101
102
103
104
105
106
107
108
109 public java.lang.String[] getForce(
110 ) {
111 java.lang.String[] array = new java.lang.String[0];
112 return (java.lang.String[]) this._forceList.toArray(array);
113 }
114
115
116
117
118
119
120 public int getForceCount(
121 ) {
122 return this._forceList.size();
123 }
124
125
126
127
128
129
130 public boolean isValid(
131 ) {
132 try {
133 validate();
134 } catch (org.exolab.castor.xml.ValidationException vex) {
135 return false;
136 }
137 return true;
138 }
139
140
141
142
143
144
145
146 public java.util.Iterator iterateForce(
147 ) {
148 return this._forceList.iterator();
149 }
150
151
152
153
154
155
156
157
158
159
160 public void marshal(
161 final java.io.Writer out)
162 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
163 org.exolab.castor.xml.Marshaller.marshal(this, out);
164 }
165
166
167
168
169
170
171
172
173
174
175
176
177 public void marshal(
178 final org.xml.sax.ContentHandler handler)
179 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
180 org.exolab.castor.xml.Marshaller.marshal(this, handler);
181 }
182
183
184
185 public void removeAllForce(
186 ) {
187 this._forceList.clear();
188 }
189
190
191
192
193
194
195
196 public boolean removeForce(
197 final java.lang.String vForce) {
198 boolean removed = _forceList.remove(vForce);
199 return removed;
200 }
201
202
203
204
205
206
207
208 public java.lang.String removeForceAt(
209 final int index) {
210 java.lang.Object obj = this._forceList.remove(index);
211 return (java.lang.String) obj;
212 }
213
214
215
216
217
218
219
220
221
222 public void setForce(
223 final int index,
224 final java.lang.String vForce)
225 throws java.lang.IndexOutOfBoundsException {
226
227 if (index < 0 || index >= this._forceList.size()) {
228 throw new IndexOutOfBoundsException("setForce: Index value '" + index + "' not in range [0.." + (this._forceList.size() - 1) + "]");
229 }
230
231 this._forceList.set(index, vForce);
232 }
233
234
235
236
237
238
239 public void setForce(
240 final java.lang.String[] vForceArray) {
241
242 _forceList.clear();
243
244 for (int i = 0; i < vForceArray.length; i++) {
245 this._forceList.add(vForceArray[i]);
246 }
247 }
248
249
250
251
252
253
254
255
256
257
258
259
260 public static org.exolab.castor.builder.binding.xml.Forces unmarshalForces(
261 final java.io.Reader reader)
262 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
263 return (org.exolab.castor.builder.binding.xml.Forces) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.builder.binding.xml.Forces.class, reader);
264 }
265
266
267
268
269
270
271
272 public void validate(
273 )
274 throws org.exolab.castor.xml.ValidationException {
275 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
276 validator.validate(this);
277 }
278
279 }