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 AppData extends org.vamsas.client.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
41 * Field _appDataChoice
43 private org.vamsas.objects.core.AppDataChoice _appDataChoice;
48 private java.util.Vector _userList;
58 _userList = new Vector();
59 } //-- org.vamsas.objects.core.AppData()
73 public void addUser(org.vamsas.objects.core.User vUser)
74 throws java.lang.IndexOutOfBoundsException
76 _userList.addElement(vUser);
77 } //-- void addUser(org.vamsas.objects.core.User)
87 public void addUser(int index, org.vamsas.objects.core.User vUser)
88 throws java.lang.IndexOutOfBoundsException
90 _userList.insertElementAt(vUser, index);
91 } //-- void addUser(int, org.vamsas.objects.core.User)
94 * Method enumerateUser
100 public java.util.Enumeration enumerateUser()
102 return _userList.elements();
103 } //-- java.util.Enumeration enumerateUser()
106 * Note: hashCode() has not been overriden
111 public boolean equals(java.lang.Object obj)
116 if (super.equals(obj)==false)
119 if (obj instanceof AppData) {
121 AppData temp = (AppData)obj;
122 if (this._appDataChoice != null) {
123 if (temp._appDataChoice == null) return false;
124 else if (!(this._appDataChoice.equals(temp._appDataChoice)))
127 else if (temp._appDataChoice != null)
129 if (this._userList != null) {
130 if (temp._userList == null) return false;
131 else if (!(this._userList.equals(temp._userList)))
134 else if (temp._userList != null)
139 } //-- boolean equals(java.lang.Object)
142 * Returns the value of field 'appDataChoice'.
144 * @return AppDataChoice
145 * @return the value of field 'appDataChoice'.
147 public org.vamsas.objects.core.AppDataChoice getAppDataChoice()
149 return this._appDataChoice;
150 } //-- org.vamsas.objects.core.AppDataChoice getAppDataChoice()
160 public org.vamsas.objects.core.User getUser(int index)
161 throws java.lang.IndexOutOfBoundsException
163 //-- check bounds for index
164 if ((index < 0) || (index > _userList.size())) {
165 throw new IndexOutOfBoundsException("getUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]");
168 return (org.vamsas.objects.core.User) _userList.elementAt(index);
169 } //-- org.vamsas.objects.core.User getUser(int)
178 public org.vamsas.objects.core.User[] getUser()
180 int size = _userList.size();
181 org.vamsas.objects.core.User[] mArray = new org.vamsas.objects.core.User[size];
182 for (int index = 0; index < size; index++) {
183 mArray[index] = (org.vamsas.objects.core.User) _userList.elementAt(index);
186 } //-- org.vamsas.objects.core.User[] getUser()
189 * Method getUserCount
195 public int getUserCount()
197 return _userList.size();
198 } //-- int getUserCount()
207 public boolean isValid()
212 catch (org.exolab.castor.xml.ValidationException vex) {
216 } //-- boolean isValid()
225 public void marshal(java.io.Writer out)
226 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
229 Marshaller.marshal(this, out);
230 } //-- void marshal(java.io.Writer)
239 public void marshal(org.xml.sax.ContentHandler handler)
240 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
243 Marshaller.marshal(this, handler);
244 } //-- void marshal(org.xml.sax.ContentHandler)
247 * Method removeAllUser
250 public void removeAllUser()
252 _userList.removeAllElements();
253 } //-- void removeAllUser()
263 public org.vamsas.objects.core.User removeUser(int index)
265 java.lang.Object obj = _userList.elementAt(index);
266 _userList.removeElementAt(index);
267 return (org.vamsas.objects.core.User) obj;
268 } //-- org.vamsas.objects.core.User removeUser(int)
271 * Sets the value of field 'appDataChoice'.
273 * @param appDataChoice the value of field 'appDataChoice'.
275 public void setAppDataChoice(org.vamsas.objects.core.AppDataChoice appDataChoice)
277 this._appDataChoice = appDataChoice;
278 } //-- void setAppDataChoice(org.vamsas.objects.core.AppDataChoice)
288 public void setUser(int index, org.vamsas.objects.core.User vUser)
289 throws java.lang.IndexOutOfBoundsException
291 //-- check bounds for index
292 if ((index < 0) || (index > _userList.size())) {
293 throw new IndexOutOfBoundsException("setUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]");
295 _userList.setElementAt(vUser, index);
296 } //-- void setUser(int, org.vamsas.objects.core.User)
305 public void setUser(org.vamsas.objects.core.User[] userArray)
308 _userList.removeAllElements();
309 for (int i = 0; i < userArray.length; i++) {
310 _userList.addElement(userArray[i]);
312 } //-- void setUser(org.vamsas.objects.core.User)
322 public static org.vamsas.objects.core.AppData unmarshal(java.io.Reader reader)
323 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
325 return (org.vamsas.objects.core.AppData) Unmarshaller.unmarshal(org.vamsas.objects.core.AppData.class, reader);
326 } //-- org.vamsas.objects.core.AppData unmarshal(java.io.Reader)
332 public void validate()
333 throws org.exolab.castor.xml.ValidationException
335 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
336 validator.validate(this);
337 } //-- void validate()