part implementation of simpleClient and refactoring of ClientDocument.
[vamsas.git] / src / org / vamsas / objects / core / ApplicationData.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package org.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
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;
25
26 /**
27  * Class ApplicationData.
28  * 
29  * @version $Revision$ $Date$
30  */
31 public class ApplicationData extends org.vamsas.client.object 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Field _applicationList
42      */
43     private java.util.Vector _applicationList;
44
45
46       //----------------/
47      //- Constructors -/
48     //----------------/
49
50     public ApplicationData() 
51      {
52         super();
53         _applicationList = new Vector();
54     } //-- org.vamsas.objects.core.ApplicationData()
55
56
57       //-----------/
58      //- Methods -/
59     //-----------/
60
61     /**
62      * Method addApplication
63      * 
64      * 
65      * 
66      * @param vApplication
67      */
68     public void addApplication(org.vamsas.objects.core.Application vApplication)
69         throws java.lang.IndexOutOfBoundsException
70     {
71         _applicationList.addElement(vApplication);
72     } //-- void addApplication(org.vamsas.objects.core.Application) 
73
74     /**
75      * Method addApplication
76      * 
77      * 
78      * 
79      * @param index
80      * @param vApplication
81      */
82     public void addApplication(int index, org.vamsas.objects.core.Application vApplication)
83         throws java.lang.IndexOutOfBoundsException
84     {
85         _applicationList.insertElementAt(vApplication, index);
86     } //-- void addApplication(int, org.vamsas.objects.core.Application) 
87
88     /**
89      * Method enumerateApplication
90      * 
91      * 
92      * 
93      * @return Enumeration
94      */
95     public java.util.Enumeration enumerateApplication()
96     {
97         return _applicationList.elements();
98     } //-- java.util.Enumeration enumerateApplication() 
99
100     /**
101      * Note: hashCode() has not been overriden
102      * 
103      * @param obj
104      * @return boolean
105      */
106     public boolean equals(java.lang.Object obj)
107     {
108         if ( this == obj )
109             return true;
110         
111         if (super.equals(obj)==false)
112             return false;
113         
114         if (obj instanceof ApplicationData) {
115         
116             ApplicationData temp = (ApplicationData)obj;
117             if (this._applicationList != null) {
118                 if (temp._applicationList == null) return false;
119                 else if (!(this._applicationList.equals(temp._applicationList))) 
120                     return false;
121             }
122             else if (temp._applicationList != null)
123                 return false;
124             return true;
125         }
126         return false;
127     } //-- boolean equals(java.lang.Object) 
128
129     /**
130      * Method getApplication
131      * 
132      * 
133      * 
134      * @param index
135      * @return Application
136      */
137     public org.vamsas.objects.core.Application getApplication(int index)
138         throws java.lang.IndexOutOfBoundsException
139     {
140         //-- check bounds for index
141         if ((index < 0) || (index > _applicationList.size())) {
142             throw new IndexOutOfBoundsException("getApplication: Index value '"+index+"' not in range [0.."+_applicationList.size()+ "]");
143         }
144         
145         return (org.vamsas.objects.core.Application) _applicationList.elementAt(index);
146     } //-- org.vamsas.objects.core.Application getApplication(int) 
147
148     /**
149      * Method getApplication
150      * 
151      * 
152      * 
153      * @return Application
154      */
155     public org.vamsas.objects.core.Application[] getApplication()
156     {
157         int size = _applicationList.size();
158         org.vamsas.objects.core.Application[] mArray = new org.vamsas.objects.core.Application[size];
159         for (int index = 0; index < size; index++) {
160             mArray[index] = (org.vamsas.objects.core.Application) _applicationList.elementAt(index);
161         }
162         return mArray;
163     } //-- org.vamsas.objects.core.Application[] getApplication() 
164
165     /**
166      * Method getApplicationCount
167      * 
168      * 
169      * 
170      * @return int
171      */
172     public int getApplicationCount()
173     {
174         return _applicationList.size();
175     } //-- int getApplicationCount() 
176
177     /**
178      * Method isValid
179      * 
180      * 
181      * 
182      * @return boolean
183      */
184     public boolean isValid()
185     {
186         try {
187             validate();
188         }
189         catch (org.exolab.castor.xml.ValidationException vex) {
190             return false;
191         }
192         return true;
193     } //-- boolean isValid() 
194
195     /**
196      * Method marshal
197      * 
198      * 
199      * 
200      * @param out
201      */
202     public void marshal(java.io.Writer out)
203         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
204     {
205         
206         Marshaller.marshal(this, out);
207     } //-- void marshal(java.io.Writer) 
208
209     /**
210      * Method marshal
211      * 
212      * 
213      * 
214      * @param handler
215      */
216     public void marshal(org.xml.sax.ContentHandler handler)
217         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
218     {
219         
220         Marshaller.marshal(this, handler);
221     } //-- void marshal(org.xml.sax.ContentHandler) 
222
223     /**
224      * Method removeAllApplication
225      * 
226      */
227     public void removeAllApplication()
228     {
229         _applicationList.removeAllElements();
230     } //-- void removeAllApplication() 
231
232     /**
233      * Method removeApplication
234      * 
235      * 
236      * 
237      * @param index
238      * @return Application
239      */
240     public org.vamsas.objects.core.Application removeApplication(int index)
241     {
242         java.lang.Object obj = _applicationList.elementAt(index);
243         _applicationList.removeElementAt(index);
244         return (org.vamsas.objects.core.Application) obj;
245     } //-- org.vamsas.objects.core.Application removeApplication(int) 
246
247     /**
248      * Method setApplication
249      * 
250      * 
251      * 
252      * @param index
253      * @param vApplication
254      */
255     public void setApplication(int index, org.vamsas.objects.core.Application vApplication)
256         throws java.lang.IndexOutOfBoundsException
257     {
258         //-- check bounds for index
259         if ((index < 0) || (index > _applicationList.size())) {
260             throw new IndexOutOfBoundsException("setApplication: Index value '"+index+"' not in range [0.."+_applicationList.size()+ "]");
261         }
262         _applicationList.setElementAt(vApplication, index);
263     } //-- void setApplication(int, org.vamsas.objects.core.Application) 
264
265     /**
266      * Method setApplication
267      * 
268      * 
269      * 
270      * @param applicationArray
271      */
272     public void setApplication(org.vamsas.objects.core.Application[] applicationArray)
273     {
274         //-- copy array
275         _applicationList.removeAllElements();
276         for (int i = 0; i < applicationArray.length; i++) {
277             _applicationList.addElement(applicationArray[i]);
278         }
279     } //-- void setApplication(org.vamsas.objects.core.Application) 
280
281     /**
282      * Method unmarshal
283      * 
284      * 
285      * 
286      * @param reader
287      * @return ApplicationData
288      */
289     public static org.vamsas.objects.core.ApplicationData unmarshal(java.io.Reader reader)
290         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
291     {
292         return (org.vamsas.objects.core.ApplicationData) Unmarshaller.unmarshal(org.vamsas.objects.core.ApplicationData.class, reader);
293     } //-- org.vamsas.objects.core.ApplicationData unmarshal(java.io.Reader) 
294
295     /**
296      * Method validate
297      * 
298      */
299     public void validate()
300         throws org.exolab.castor.xml.ValidationException
301     {
302         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
303         validator.validate(this);
304     } //-- void validate() 
305
306 }