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;
27 * Class ApplicationData.
29 * @version $Revision$ $Date$
31 public class ApplicationData extends org.vamsas.objects.core.AppData
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.util.Vector _userList;
65 public ApplicationData()
68 _userList = new Vector();
69 } //-- org.vamsas.objects.core.ApplicationData()
83 public void addUser(org.vamsas.objects.core.User vUser)
84 throws java.lang.IndexOutOfBoundsException
86 _userList.addElement(vUser);
87 } //-- void addUser(org.vamsas.objects.core.User)
97 public void addUser(int index, org.vamsas.objects.core.User vUser)
98 throws java.lang.IndexOutOfBoundsException
100 _userList.insertElementAt(vUser, index);
101 } //-- void addUser(int, org.vamsas.objects.core.User)
104 * Method enumerateUser
108 * @return Enumeration
110 public java.util.Enumeration enumerateUser()
112 return _userList.elements();
113 } //-- java.util.Enumeration enumerateUser()
116 * Note: hashCode() has not been overriden
121 public boolean equals(java.lang.Object obj)
126 if (super.equals(obj)==false)
129 if (obj instanceof ApplicationData) {
131 ApplicationData temp = (ApplicationData)obj;
132 if (this._version != null) {
133 if (temp._version == null) return false;
134 else if (!(this._version.equals(temp._version)))
137 else if (temp._version != null)
139 if (this._name != null) {
140 if (temp._name == null) return false;
141 else if (!(this._name.equals(temp._name)))
144 else if (temp._name != null)
146 if (this._urn != null) {
147 if (temp._urn == null) return false;
148 else if (!(this._urn.equals(temp._urn)))
151 else if (temp._urn != null)
153 if (this._userList != null) {
154 if (temp._userList == null) return false;
155 else if (!(this._userList.equals(temp._userList)))
158 else if (temp._userList != null)
163 } //-- boolean equals(java.lang.Object)
166 * Returns the value of field 'name'.
169 * @return the value of field 'name'.
171 public java.lang.String getName()
174 } //-- java.lang.String getName()
177 * Returns the value of field 'urn'.
180 * @return the value of field 'urn'.
182 public java.lang.String getUrn()
185 } //-- java.lang.String getUrn()
195 public org.vamsas.objects.core.User getUser(int index)
196 throws java.lang.IndexOutOfBoundsException
198 //-- check bounds for index
199 if ((index < 0) || (index > _userList.size())) {
200 throw new IndexOutOfBoundsException("getUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]");
203 return (org.vamsas.objects.core.User) _userList.elementAt(index);
204 } //-- org.vamsas.objects.core.User getUser(int)
213 public org.vamsas.objects.core.User[] getUser()
215 int size = _userList.size();
216 org.vamsas.objects.core.User[] mArray = new org.vamsas.objects.core.User[size];
217 for (int index = 0; index < size; index++) {
218 mArray[index] = (org.vamsas.objects.core.User) _userList.elementAt(index);
221 } //-- org.vamsas.objects.core.User[] getUser()
224 * Method getUserCount
230 public int getUserCount()
232 return _userList.size();
233 } //-- int getUserCount()
236 * Returns the value of field 'version'.
239 * @return the value of field 'version'.
241 public java.lang.String getVersion()
243 return this._version;
244 } //-- java.lang.String getVersion()
253 public boolean isValid()
258 catch (org.exolab.castor.xml.ValidationException vex) {
262 } //-- boolean isValid()
271 public void marshal(java.io.Writer out)
272 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
275 Marshaller.marshal(this, out);
276 } //-- void marshal(java.io.Writer)
285 public void marshal(org.xml.sax.ContentHandler handler)
286 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
289 Marshaller.marshal(this, handler);
290 } //-- void marshal(org.xml.sax.ContentHandler)
293 * Method removeAllUser
296 public void removeAllUser()
298 _userList.removeAllElements();
299 } //-- void removeAllUser()
309 public org.vamsas.objects.core.User removeUser(int index)
311 java.lang.Object obj = _userList.elementAt(index);
312 _userList.removeElementAt(index);
313 return (org.vamsas.objects.core.User) obj;
314 } //-- org.vamsas.objects.core.User removeUser(int)
317 * Sets the value of field 'name'.
319 * @param name the value of field 'name'.
321 public void setName(java.lang.String name)
324 } //-- void setName(java.lang.String)
327 * Sets the value of field 'urn'.
329 * @param urn the value of field 'urn'.
331 public void setUrn(java.lang.String urn)
334 } //-- void setUrn(java.lang.String)
344 public void setUser(int index, org.vamsas.objects.core.User vUser)
345 throws java.lang.IndexOutOfBoundsException
347 //-- check bounds for index
348 if ((index < 0) || (index > _userList.size())) {
349 throw new IndexOutOfBoundsException("setUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]");
351 _userList.setElementAt(vUser, index);
352 } //-- void setUser(int, org.vamsas.objects.core.User)
361 public void setUser(org.vamsas.objects.core.User[] userArray)
364 _userList.removeAllElements();
365 for (int i = 0; i < userArray.length; i++) {
366 _userList.addElement(userArray[i]);
368 } //-- void setUser(org.vamsas.objects.core.User)
371 * Sets the value of field 'version'.
373 * @param version the value of field 'version'.
375 public void setVersion(java.lang.String version)
377 this._version = version;
378 } //-- void setVersion(java.lang.String)
388 public static org.vamsas.objects.core.AppData unmarshal(java.io.Reader reader)
389 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
391 return (org.vamsas.objects.core.ApplicationData) Unmarshaller.unmarshal(org.vamsas.objects.core.ApplicationData.class, reader);
392 } //-- org.vamsas.objects.core.AppData unmarshal(java.io.Reader)
398 public void validate()
399 throws org.exolab.castor.xml.ValidationException
401 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
402 validator.validate(this);
403 } //-- void validate()