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.Vobject
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;
56 * contains unassociated trees and a number of analysis
60 private java.util.Vector _VAMSASList;
63 * Field _applicationDataList
65 private java.util.Vector _applicationDataList;
68 * Field _attachmentList
70 private java.util.Vector _attachmentList;
77 public VamsasDocument()
80 _VAMSASList = new Vector();
81 _applicationDataList = new Vector();
82 _attachmentList = new Vector();
83 } //-- org.vamsas.objects.core.VamsasDocument()
91 * Method addApplicationData
95 * @param vApplicationData
97 public void addApplicationData(ApplicationData vApplicationData)
98 throws java.lang.IndexOutOfBoundsException
100 _applicationDataList.addElement(vApplicationData);
101 } //-- void addApplicationData(ApplicationData)
104 * Method addApplicationData
109 * @param vApplicationData
111 public void addApplicationData(int index, ApplicationData vApplicationData)
112 throws java.lang.IndexOutOfBoundsException
114 _applicationDataList.insertElementAt(vApplicationData, index);
115 } //-- void addApplicationData(int, ApplicationData)
118 * Method addAttachment
124 public void addAttachment(Attachment vAttachment)
125 throws java.lang.IndexOutOfBoundsException
127 _attachmentList.addElement(vAttachment);
128 } //-- void addAttachment(Attachment)
131 * Method addAttachment
138 public void addAttachment(int index, Attachment vAttachment)
139 throws java.lang.IndexOutOfBoundsException
141 _attachmentList.insertElementAt(vAttachment, index);
142 } //-- void addAttachment(int, Attachment)
151 public void addVAMSAS(VAMSAS vVAMSAS)
152 throws java.lang.IndexOutOfBoundsException
154 _VAMSASList.addElement(vVAMSAS);
155 } //-- void addVAMSAS(VAMSAS)
165 public void addVAMSAS(int index, VAMSAS vVAMSAS)
166 throws java.lang.IndexOutOfBoundsException
168 _VAMSASList.insertElementAt(vVAMSAS, index);
169 } //-- void addVAMSAS(int, VAMSAS)
172 * Method enumerateApplicationData
176 * @return Enumeration
178 public java.util.Enumeration enumerateApplicationData()
180 return _applicationDataList.elements();
181 } //-- java.util.Enumeration enumerateApplicationData()
184 * Method enumerateAttachment
188 * @return Enumeration
190 public java.util.Enumeration enumerateAttachment()
192 return _attachmentList.elements();
193 } //-- java.util.Enumeration enumerateAttachment()
196 * Method enumerateVAMSAS
200 * @return Enumeration
202 public java.util.Enumeration enumerateVAMSAS()
204 return _VAMSASList.elements();
205 } //-- java.util.Enumeration enumerateVAMSAS()
208 * Note: hashCode() has not been overriden
213 public boolean equals(java.lang.Object obj)
218 if (super.equals(obj)==false)
221 if (obj instanceof VamsasDocument) {
223 VamsasDocument temp = (VamsasDocument)obj;
224 if (this._version != null) {
225 if (temp._version == null) return false;
226 else if (!(this._version.equals(temp._version)))
229 else if (temp._version != null)
231 if (this._lockFile != null) {
232 if (temp._lockFile == null) return false;
233 else if (!(this._lockFile.equals(temp._lockFile)))
236 else if (temp._lockFile != null)
238 if (this._provenance != null) {
239 if (temp._provenance == null) return false;
240 else if (!(this._provenance.equals(temp._provenance)))
243 else if (temp._provenance != null)
245 if (this._VAMSASList != null) {
246 if (temp._VAMSASList == null) return false;
247 else if (!(this._VAMSASList.equals(temp._VAMSASList)))
250 else if (temp._VAMSASList != null)
252 if (this._applicationDataList != null) {
253 if (temp._applicationDataList == null) return false;
254 else if (!(this._applicationDataList.equals(temp._applicationDataList)))
257 else if (temp._applicationDataList != null)
259 if (this._attachmentList != null) {
260 if (temp._attachmentList == null) return false;
261 else if (!(this._attachmentList.equals(temp._attachmentList)))
264 else if (temp._attachmentList != null)
269 } //-- boolean equals(java.lang.Object)
272 * Method getApplicationData
277 * @return ApplicationData
279 public ApplicationData getApplicationData(int index)
280 throws java.lang.IndexOutOfBoundsException
282 //-- check bounds for index
283 if ((index < 0) || (index > _applicationDataList.size())) {
284 throw new IndexOutOfBoundsException("getApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]");
287 return (ApplicationData) _applicationDataList.elementAt(index);
288 } //-- ApplicationData getApplicationData(int)
291 * Method getApplicationData
295 * @return ApplicationData
297 public ApplicationData[] getApplicationData()
299 int size = _applicationDataList.size();
300 ApplicationData[] mArray = new ApplicationData[size];
301 for (int index = 0; index < size; index++) {
302 mArray[index] = (ApplicationData) _applicationDataList.elementAt(index);
305 } //-- ApplicationData[] getApplicationData()
308 * Method getApplicationDataCount
314 public int getApplicationDataCount()
316 return _applicationDataList.size();
317 } //-- int getApplicationDataCount()
320 * Method getAttachment
327 public Attachment getAttachment(int index)
328 throws java.lang.IndexOutOfBoundsException
330 //-- check bounds for index
331 if ((index < 0) || (index > _attachmentList.size())) {
332 throw new IndexOutOfBoundsException("getAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]");
335 return (Attachment) _attachmentList.elementAt(index);
336 } //-- Attachment getAttachment(int)
339 * Method getAttachment
345 public Attachment[] getAttachment()
347 int size = _attachmentList.size();
348 Attachment[] mArray = new Attachment[size];
349 for (int index = 0; index < size; index++) {
350 mArray[index] = (Attachment) _attachmentList.elementAt(index);
353 } //-- Attachment[] getAttachment()
356 * Method getAttachmentCount
362 public int getAttachmentCount()
364 return _attachmentList.size();
365 } //-- int getAttachmentCount()
368 * Returns the value of field 'lockFile'.
371 * @return the value of field 'lockFile'.
373 public org.vamsas.objects.core.LockFile getLockFile()
375 return this._lockFile;
376 } //-- org.vamsas.objects.core.LockFile getLockFile()
379 * Returns the value of field 'provenance'.
382 * @return the value of field 'provenance'.
384 public Provenance getProvenance()
386 return this._provenance;
387 } //-- Provenance getProvenance()
397 public VAMSAS getVAMSAS(int index)
398 throws java.lang.IndexOutOfBoundsException
400 //-- check bounds for index
401 if ((index < 0) || (index > _VAMSASList.size())) {
402 throw new IndexOutOfBoundsException("getVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
405 return (VAMSAS) _VAMSASList.elementAt(index);
406 } //-- VAMSAS getVAMSAS(int)
415 public VAMSAS[] getVAMSAS()
417 int size = _VAMSASList.size();
418 VAMSAS[] mArray = new VAMSAS[size];
419 for (int index = 0; index < size; index++) {
420 mArray[index] = (VAMSAS) _VAMSASList.elementAt(index);
423 } //-- VAMSAS[] getVAMSAS()
426 * Method getVAMSASCount
432 public int getVAMSASCount()
434 return _VAMSASList.size();
435 } //-- int getVAMSASCount()
438 * Returns the value of field 'version'. The field 'version'
439 * has the following description: Vamsas Document Version
443 * @return the value of field 'version'.
445 public java.lang.String getVersion()
447 return this._version;
448 } //-- java.lang.String getVersion()
457 public boolean isValid()
462 catch (org.exolab.castor.xml.ValidationException vex) {
466 } //-- boolean isValid()
475 public void marshal(java.io.Writer out)
476 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
479 Marshaller.marshal(this, out);
480 } //-- void marshal(java.io.Writer)
489 public void marshal(org.xml.sax.ContentHandler handler)
490 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
493 Marshaller.marshal(this, handler);
494 } //-- void marshal(org.xml.sax.ContentHandler)
497 * Method removeAllApplicationData
500 public void removeAllApplicationData()
502 _applicationDataList.removeAllElements();
503 } //-- void removeAllApplicationData()
506 * Method removeAllAttachment
509 public void removeAllAttachment()
511 _attachmentList.removeAllElements();
512 } //-- void removeAllAttachment()
515 * Method removeAllVAMSAS
518 public void removeAllVAMSAS()
520 _VAMSASList.removeAllElements();
521 } //-- void removeAllVAMSAS()
524 * Method removeApplicationData
529 * @return ApplicationData
531 public ApplicationData removeApplicationData(int index)
533 java.lang.Object obj = _applicationDataList.elementAt(index);
534 _applicationDataList.removeElementAt(index);
535 return (ApplicationData) obj;
536 } //-- ApplicationData removeApplicationData(int)
539 * Method removeAttachment
546 public Attachment removeAttachment(int index)
548 java.lang.Object obj = _attachmentList.elementAt(index);
549 _attachmentList.removeElementAt(index);
550 return (Attachment) obj;
551 } //-- Attachment removeAttachment(int)
554 * Method removeVAMSAS
561 public VAMSAS removeVAMSAS(int index)
563 java.lang.Object obj = _VAMSASList.elementAt(index);
564 _VAMSASList.removeElementAt(index);
566 } //-- VAMSAS removeVAMSAS(int)
569 * Method setApplicationData
574 * @param vApplicationData
576 public void setApplicationData(int index, ApplicationData vApplicationData)
577 throws java.lang.IndexOutOfBoundsException
579 //-- check bounds for index
580 if ((index < 0) || (index > _applicationDataList.size())) {
581 throw new IndexOutOfBoundsException("setApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]");
583 _applicationDataList.setElementAt(vApplicationData, index);
584 } //-- void setApplicationData(int, ApplicationData)
587 * Method setApplicationData
591 * @param applicationDataArray
593 public void setApplicationData(ApplicationData[] applicationDataArray)
596 _applicationDataList.removeAllElements();
597 for (int i = 0; i < applicationDataArray.length; i++) {
598 _applicationDataList.addElement(applicationDataArray[i]);
600 } //-- void setApplicationData(ApplicationData)
603 * Method setAttachment
610 public void setAttachment(int index, Attachment vAttachment)
611 throws java.lang.IndexOutOfBoundsException
613 //-- check bounds for index
614 if ((index < 0) || (index > _attachmentList.size())) {
615 throw new IndexOutOfBoundsException("setAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]");
617 _attachmentList.setElementAt(vAttachment, index);
618 } //-- void setAttachment(int, Attachment)
621 * Method setAttachment
625 * @param attachmentArray
627 public void setAttachment(Attachment[] attachmentArray)
630 _attachmentList.removeAllElements();
631 for (int i = 0; i < attachmentArray.length; i++) {
632 _attachmentList.addElement(attachmentArray[i]);
634 } //-- void setAttachment(Attachment)
637 * Sets the value of field 'lockFile'.
639 * @param lockFile the value of field 'lockFile'.
641 public void setLockFile(org.vamsas.objects.core.LockFile lockFile)
643 this._lockFile = lockFile;
644 } //-- void setLockFile(org.vamsas.objects.core.LockFile)
647 * Sets the value of field 'provenance'.
649 * @param provenance the value of field 'provenance'.
651 public void setProvenance(Provenance provenance)
653 this._provenance = provenance;
654 } //-- void setProvenance(Provenance)
664 public void setVAMSAS(int index, VAMSAS vVAMSAS)
665 throws java.lang.IndexOutOfBoundsException
667 //-- check bounds for index
668 if ((index < 0) || (index > _VAMSASList.size())) {
669 throw new IndexOutOfBoundsException("setVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
671 _VAMSASList.setElementAt(vVAMSAS, index);
672 } //-- void setVAMSAS(int, VAMSAS)
681 public void setVAMSAS(VAMSAS[] VAMSASArray)
684 _VAMSASList.removeAllElements();
685 for (int i = 0; i < VAMSASArray.length; i++) {
686 _VAMSASList.addElement(VAMSASArray[i]);
688 } //-- void setVAMSAS(VAMSAS)
691 * Sets the value of field 'version'. The field 'version' has
692 * the following description: Vamsas Document Version Number
694 * @param version the value of field 'version'.
696 public void setVersion(java.lang.String version)
698 this._version = version;
699 } //-- void setVersion(java.lang.String)
707 * @return VamsasDocument
709 public static org.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader reader)
710 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
712 return (org.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(org.vamsas.objects.core.VamsasDocument.class, reader);
713 } //-- org.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader)
719 public void validate()
720 throws org.exolab.castor.xml.ValidationException
722 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
723 validator.validate(this);
724 } //-- void validate()