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 VamsasDocument.
29 * @version $Revision$ $Date$
31 public class VamsasDocument extends org.vamsas.client.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
41 * Vamsas Document Version Number
43 private java.lang.String _version;
48 private org.vamsas.objects.core.LockFile _lockFile;
53 private Provenance _provenance;
58 private java.util.Vector _VAMSASList;
61 * Field _applicationData
63 private ApplicationData _applicationData;
70 public VamsasDocument()
73 _VAMSASList = new Vector();
74 } //-- org.vamsas.objects.core.VamsasDocument()
88 public void addVAMSAS(VAMSAS vVAMSAS)
89 throws java.lang.IndexOutOfBoundsException
91 _VAMSASList.addElement(vVAMSAS);
92 } //-- void addVAMSAS(VAMSAS)
102 public void addVAMSAS(int index, VAMSAS vVAMSAS)
103 throws java.lang.IndexOutOfBoundsException
105 _VAMSASList.insertElementAt(vVAMSAS, index);
106 } //-- void addVAMSAS(int, VAMSAS)
109 * Method enumerateVAMSAS
113 * @return Enumeration
115 public java.util.Enumeration enumerateVAMSAS()
117 return _VAMSASList.elements();
118 } //-- java.util.Enumeration enumerateVAMSAS()
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 VamsasDocument) {
136 VamsasDocument temp = (VamsasDocument)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._lockFile != null) {
145 if (temp._lockFile == null) return false;
146 else if (!(this._lockFile.equals(temp._lockFile)))
149 else if (temp._lockFile != null)
151 if (this._provenance != null) {
152 if (temp._provenance == null) return false;
153 else if (!(this._provenance.equals(temp._provenance)))
156 else if (temp._provenance != null)
158 if (this._VAMSASList != null) {
159 if (temp._VAMSASList == null) return false;
160 else if (!(this._VAMSASList.equals(temp._VAMSASList)))
163 else if (temp._VAMSASList != null)
165 if (this._applicationData != null) {
166 if (temp._applicationData == null) return false;
167 else if (!(this._applicationData.equals(temp._applicationData)))
170 else if (temp._applicationData != null)
175 } //-- boolean equals(java.lang.Object)
178 * Returns the value of field 'applicationData'.
180 * @return ApplicationData
181 * @return the value of field 'applicationData'.
183 public ApplicationData getApplicationData()
185 return this._applicationData;
186 } //-- ApplicationData getApplicationData()
189 * Returns the value of field 'lockFile'.
192 * @return the value of field 'lockFile'.
194 public org.vamsas.objects.core.LockFile getLockFile()
196 return this._lockFile;
197 } //-- org.vamsas.objects.core.LockFile getLockFile()
200 * Returns the value of field 'provenance'.
203 * @return the value of field 'provenance'.
205 public Provenance getProvenance()
207 return this._provenance;
208 } //-- Provenance getProvenance()
218 public VAMSAS getVAMSAS(int index)
219 throws java.lang.IndexOutOfBoundsException
221 //-- check bounds for index
222 if ((index < 0) || (index > _VAMSASList.size())) {
223 throw new IndexOutOfBoundsException("getVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
226 return (VAMSAS) _VAMSASList.elementAt(index);
227 } //-- VAMSAS getVAMSAS(int)
236 public VAMSAS[] getVAMSAS()
238 int size = _VAMSASList.size();
239 VAMSAS[] mArray = new VAMSAS[size];
240 for (int index = 0; index < size; index++) {
241 mArray[index] = (VAMSAS) _VAMSASList.elementAt(index);
244 } //-- VAMSAS[] getVAMSAS()
247 * Method getVAMSASCount
253 public int getVAMSASCount()
255 return _VAMSASList.size();
256 } //-- int getVAMSASCount()
259 * Returns the value of field 'version'. The field 'version'
260 * has the following description: Vamsas Document Version
264 * @return the value of field 'version'.
266 public java.lang.String getVersion()
268 return this._version;
269 } //-- java.lang.String getVersion()
278 public boolean isValid()
283 catch (org.exolab.castor.xml.ValidationException vex) {
287 } //-- boolean isValid()
296 public void marshal(java.io.Writer out)
297 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
300 Marshaller.marshal(this, out);
301 } //-- void marshal(java.io.Writer)
310 public void marshal(org.xml.sax.ContentHandler handler)
311 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
314 Marshaller.marshal(this, handler);
315 } //-- void marshal(org.xml.sax.ContentHandler)
318 * Method removeAllVAMSAS
321 public void removeAllVAMSAS()
323 _VAMSASList.removeAllElements();
324 } //-- void removeAllVAMSAS()
327 * Method removeVAMSAS
334 public VAMSAS removeVAMSAS(int index)
336 java.lang.Object obj = _VAMSASList.elementAt(index);
337 _VAMSASList.removeElementAt(index);
339 } //-- VAMSAS removeVAMSAS(int)
342 * Sets the value of field 'applicationData'.
344 * @param applicationData the value of field 'applicationData'.
346 public void setApplicationData(ApplicationData applicationData)
348 this._applicationData = applicationData;
349 } //-- void setApplicationData(ApplicationData)
352 * Sets the value of field 'lockFile'.
354 * @param lockFile the value of field 'lockFile'.
356 public void setLockFile(org.vamsas.objects.core.LockFile lockFile)
358 this._lockFile = lockFile;
359 } //-- void setLockFile(org.vamsas.objects.core.LockFile)
362 * Sets the value of field 'provenance'.
364 * @param provenance the value of field 'provenance'.
366 public void setProvenance(Provenance provenance)
368 this._provenance = provenance;
369 } //-- void setProvenance(Provenance)
379 public void setVAMSAS(int index, VAMSAS vVAMSAS)
380 throws java.lang.IndexOutOfBoundsException
382 //-- check bounds for index
383 if ((index < 0) || (index > _VAMSASList.size())) {
384 throw new IndexOutOfBoundsException("setVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
386 _VAMSASList.setElementAt(vVAMSAS, index);
387 } //-- void setVAMSAS(int, VAMSAS)
396 public void setVAMSAS(VAMSAS[] VAMSASArray)
399 _VAMSASList.removeAllElements();
400 for (int i = 0; i < VAMSASArray.length; i++) {
401 _VAMSASList.addElement(VAMSASArray[i]);
403 } //-- void setVAMSAS(VAMSAS)
406 * Sets the value of field 'version'. The field 'version' has
407 * the following description: Vamsas Document Version Number
409 * @param version the value of field 'version'.
411 public void setVersion(java.lang.String version)
413 this._version = version;
414 } //-- void setVersion(java.lang.String)
422 * @return VamsasDocument
424 public static org.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader reader)
425 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
427 return (org.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(org.vamsas.objects.core.VamsasDocument.class, reader);
428 } //-- org.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader)
434 public void validate()
435 throws org.exolab.castor.xml.ValidationException
437 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
438 validator.validate(this);
439 } //-- void validate()