2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
8 package org.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.Enumeration;
19 import java.util.Vector;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler;
29 * @version $Revision$ $Date$
31 public class Application extends org.vamsas.client.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
43 private java.lang.String _version;
48 private java.lang.String _name;
53 private java.lang.String _urn;
58 private java.lang.String _data;
63 private java.util.Vector _userList;
73 _userList = new Vector();
74 } //-- org.vamsas.objects.core.Application()
88 public void addUser(org.vamsas.objects.core.User vUser)
89 throws java.lang.IndexOutOfBoundsException
91 _userList.addElement(vUser);
92 } //-- void addUser(org.vamsas.objects.core.User)
102 public void addUser(int index, org.vamsas.objects.core.User vUser)
103 throws java.lang.IndexOutOfBoundsException
105 _userList.insertElementAt(vUser, index);
106 } //-- void addUser(int, org.vamsas.objects.core.User)
109 * Method enumerateUser
113 * @return Enumeration
115 public java.util.Enumeration enumerateUser()
117 return _userList.elements();
118 } //-- java.util.Enumeration enumerateUser()
121 * Note: hashCode() has not been overriden
126 public boolean equals(java.lang.Object obj)
131 if (super.equals(obj)==false)
134 if (obj instanceof Application) {
136 Application temp = (Application)obj;
137 if (this._version != null) {
138 if (temp._version == null) return false;
139 else if (!(this._version.equals(temp._version)))
142 else if (temp._version != null)
144 if (this._name != null) {
145 if (temp._name == null) return false;
146 else if (!(this._name.equals(temp._name)))
149 else if (temp._name != null)
151 if (this._urn != null) {
152 if (temp._urn == null) return false;
153 else if (!(this._urn.equals(temp._urn)))
156 else if (temp._urn != null)
158 if (this._data != null) {
159 if (temp._data == null) return false;
160 else if (!(this._data.equals(temp._data)))
163 else if (temp._data != null)
165 if (this._userList != null) {
166 if (temp._userList == null) return false;
167 else if (!(this._userList.equals(temp._userList)))
170 else if (temp._userList != null)
175 } //-- boolean equals(java.lang.Object)
178 * Returns the value of field 'data'.
181 * @return the value of field 'data'.
183 public java.lang.String getData()
186 } //-- java.lang.String getData()
189 * Returns the value of field 'name'.
192 * @return the value of field 'name'.
194 public java.lang.String getName()
197 } //-- java.lang.String getName()
200 * Returns the value of field 'urn'.
203 * @return the value of field 'urn'.
205 public java.lang.String getUrn()
208 } //-- java.lang.String getUrn()
218 public org.vamsas.objects.core.User getUser(int index)
219 throws java.lang.IndexOutOfBoundsException
221 //-- check bounds for index
222 if ((index < 0) || (index > _userList.size())) {
223 throw new IndexOutOfBoundsException("getUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]");
226 return (org.vamsas.objects.core.User) _userList.elementAt(index);
227 } //-- org.vamsas.objects.core.User getUser(int)
236 public org.vamsas.objects.core.User[] getUser()
238 int size = _userList.size();
239 org.vamsas.objects.core.User[] mArray = new org.vamsas.objects.core.User[size];
240 for (int index = 0; index < size; index++) {
241 mArray[index] = (org.vamsas.objects.core.User) _userList.elementAt(index);
244 } //-- org.vamsas.objects.core.User[] getUser()
247 * Method getUserCount
253 public int getUserCount()
255 return _userList.size();
256 } //-- int getUserCount()
259 * Returns the value of field 'version'.
262 * @return the value of field 'version'.
264 public java.lang.String getVersion()
266 return this._version;
267 } //-- java.lang.String getVersion()
276 public boolean isValid()
281 catch (org.exolab.castor.xml.ValidationException vex) {
285 } //-- boolean isValid()
294 public void marshal(java.io.Writer out)
295 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
298 Marshaller.marshal(this, out);
299 } //-- void marshal(java.io.Writer)
308 public void marshal(org.xml.sax.ContentHandler handler)
309 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
312 Marshaller.marshal(this, handler);
313 } //-- void marshal(org.xml.sax.ContentHandler)
316 * Method removeAllUser
319 public void removeAllUser()
321 _userList.removeAllElements();
322 } //-- void removeAllUser()
332 public org.vamsas.objects.core.User removeUser(int index)
334 java.lang.Object obj = _userList.elementAt(index);
335 _userList.removeElementAt(index);
336 return (org.vamsas.objects.core.User) obj;
337 } //-- org.vamsas.objects.core.User removeUser(int)
340 * Sets the value of field 'data'.
342 * @param data the value of field 'data'.
344 public void setData(java.lang.String data)
347 } //-- void setData(java.lang.String)
350 * Sets the value of field 'name'.
352 * @param name the value of field 'name'.
354 public void setName(java.lang.String name)
357 } //-- void setName(java.lang.String)
360 * Sets the value of field 'urn'.
362 * @param urn the value of field 'urn'.
364 public void setUrn(java.lang.String urn)
367 } //-- void setUrn(java.lang.String)
377 public void setUser(int index, org.vamsas.objects.core.User vUser)
378 throws java.lang.IndexOutOfBoundsException
380 //-- check bounds for index
381 if ((index < 0) || (index > _userList.size())) {
382 throw new IndexOutOfBoundsException("setUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]");
384 _userList.setElementAt(vUser, index);
385 } //-- void setUser(int, org.vamsas.objects.core.User)
394 public void setUser(org.vamsas.objects.core.User[] userArray)
397 _userList.removeAllElements();
398 for (int i = 0; i < userArray.length; i++) {
399 _userList.addElement(userArray[i]);
401 } //-- void setUser(org.vamsas.objects.core.User)
404 * Sets the value of field 'version'.
406 * @param version the value of field 'version'.
408 public void setVersion(java.lang.String version)
410 this._version = version;
411 } //-- void setVersion(java.lang.String)
419 * @return Application
421 public static org.vamsas.objects.core.Application unmarshal(java.io.Reader reader)
422 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
424 return (org.vamsas.objects.core.Application) Unmarshaller.unmarshal(org.vamsas.objects.core.Application.class, reader);
425 } //-- org.vamsas.objects.core.Application unmarshal(java.io.Reader)
431 public void validate()
432 throws org.exolab.castor.xml.ValidationException
434 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
435 validator.validate(this);
436 } //-- void validate()