/*
* This class was automatically generated with
- * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
* Schema.
* $Id$
*/
//- Imported classes and packages -/
//---------------------------------/
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Serializable;
-import java.io.Writer;
-import java.util.Enumeration;
-import java.util.Vector;
-import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
-import org.exolab.castor.xml.ValidationException;
-import org.xml.sax.ContentHandler;
/**
* Class VamsasDocument.
private java.lang.String _version;
/**
- * Field _lockFile
+ * Field _lockFile.
*/
private uk.ac.vamsas.objects.core.LockFile _lockFile;
/**
- * Field _provenance
+ * Field _provenance.
*/
- private Provenance _provenance;
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
/**
* contains unassociated trees and a number of analysis sets
private java.util.Vector _VAMSASList;
/**
- * Field _applicationDataList
+ * Field _applicationDataList.
*/
private java.util.Vector _applicationDataList;
/**
- * Field _attachmentList
+ * Field _attachmentList.
*/
private java.util.Vector _attachmentList;
//- Constructors -/
//----------------/
- public VamsasDocument()
- {
+ public VamsasDocument() {
super();
- _VAMSASList = new Vector();
- _applicationDataList = new Vector();
- _attachmentList = new Vector();
- } //-- uk.ac.vamsas.objects.core.VamsasDocument()
+ this._VAMSASList = new java.util.Vector();
+ this._applicationDataList = new java.util.Vector();
+ this._attachmentList = new java.util.Vector();
+ }
//-----------/
//-----------/
/**
- * Method addApplicationData
- *
*
*
* @param vApplicationData
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
*/
- public void addApplicationData(ApplicationData vApplicationData)
- throws java.lang.IndexOutOfBoundsException
- {
- _applicationDataList.addElement(vApplicationData);
- } //-- void addApplicationData(ApplicationData)
+ public void addApplicationData(
+ final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
+ throws java.lang.IndexOutOfBoundsException {
+ this._applicationDataList.addElement(vApplicationData);
+ }
/**
- * Method addApplicationData
- *
*
*
* @param index
* @param vApplicationData
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
*/
- public void addApplicationData(int index, ApplicationData vApplicationData)
- throws java.lang.IndexOutOfBoundsException
- {
- _applicationDataList.insertElementAt(vApplicationData, index);
- } //-- void addApplicationData(int, ApplicationData)
+ public void addApplicationData(
+ final int index,
+ final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
+ throws java.lang.IndexOutOfBoundsException {
+ this._applicationDataList.add(index, vApplicationData);
+ }
/**
- * Method addAttachment
- *
*
*
* @param vAttachment
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
*/
- public void addAttachment(Attachment vAttachment)
- throws java.lang.IndexOutOfBoundsException
- {
- _attachmentList.addElement(vAttachment);
- } //-- void addAttachment(Attachment)
+ public void addAttachment(
+ final uk.ac.vamsas.objects.core.Attachment vAttachment)
+ throws java.lang.IndexOutOfBoundsException {
+ this._attachmentList.addElement(vAttachment);
+ }
/**
- * Method addAttachment
- *
*
*
* @param index
* @param vAttachment
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
*/
- public void addAttachment(int index, Attachment vAttachment)
- throws java.lang.IndexOutOfBoundsException
- {
- _attachmentList.insertElementAt(vAttachment, index);
- } //-- void addAttachment(int, Attachment)
+ public void addAttachment(
+ final int index,
+ final uk.ac.vamsas.objects.core.Attachment vAttachment)
+ throws java.lang.IndexOutOfBoundsException {
+ this._attachmentList.add(index, vAttachment);
+ }
/**
- * Method addVAMSAS
- *
*
*
* @param vVAMSAS
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
*/
- public void addVAMSAS(VAMSAS vVAMSAS)
- throws java.lang.IndexOutOfBoundsException
- {
- _VAMSASList.addElement(vVAMSAS);
- } //-- void addVAMSAS(VAMSAS)
+ public void addVAMSAS(
+ final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
+ throws java.lang.IndexOutOfBoundsException {
+ this._VAMSASList.addElement(vVAMSAS);
+ }
/**
- * Method addVAMSAS
- *
*
*
* @param index
* @param vVAMSAS
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
*/
- public void addVAMSAS(int index, VAMSAS vVAMSAS)
- throws java.lang.IndexOutOfBoundsException
- {
- _VAMSASList.insertElementAt(vVAMSAS, index);
- } //-- void addVAMSAS(int, VAMSAS)
+ public void addVAMSAS(
+ final int index,
+ final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
+ throws java.lang.IndexOutOfBoundsException {
+ this._VAMSASList.add(index, vVAMSAS);
+ }
/**
- * Method enumerateApplicationData
- *
- *
+ * Method enumerateApplicationData.
*
- * @return Enumeration
+ * @return an Enumeration over all
+ * uk.ac.vamsas.objects.core.ApplicationData elements
*/
- public java.util.Enumeration enumerateApplicationData()
- {
- return _applicationDataList.elements();
- } //-- java.util.Enumeration enumerateApplicationData()
+ public java.util.Enumeration enumerateApplicationData(
+ ) {
+ return this._applicationDataList.elements();
+ }
/**
- * Method enumerateAttachment
+ * Method enumerateAttachment.
*
- *
- *
- * @return Enumeration
+ * @return an Enumeration over all
+ * uk.ac.vamsas.objects.core.Attachment elements
*/
- public java.util.Enumeration enumerateAttachment()
- {
- return _attachmentList.elements();
- } //-- java.util.Enumeration enumerateAttachment()
+ public java.util.Enumeration enumerateAttachment(
+ ) {
+ return this._attachmentList.elements();
+ }
/**
- * Method enumerateVAMSAS
- *
- *
+ * Method enumerateVAMSAS.
*
- * @return Enumeration
+ * @return an Enumeration over all
+ * uk.ac.vamsas.objects.core.VAMSAS elements
*/
- public java.util.Enumeration enumerateVAMSAS()
- {
- return _VAMSASList.elements();
- } //-- java.util.Enumeration enumerateVAMSAS()
+ public java.util.Enumeration enumerateVAMSAS(
+ ) {
+ return this._VAMSASList.elements();
+ }
/**
- * Note: hashCode() has not been overriden
+ * Overrides the java.lang.Object.equals method.
*
* @param obj
- * @return boolean
+ * @return true if the objects are equal.
*/
- public boolean equals(java.lang.Object obj)
- {
+ public boolean equals(
+ final java.lang.Object obj) {
if ( this == obj )
return true;
return true;
}
return false;
- } //-- boolean equals(java.lang.Object)
+ }
/**
- * Method getApplicationData
- *
- *
+ * Method getApplicationData.
*
* @param index
- * @return ApplicationData
- */
- public ApplicationData getApplicationData(int index)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _applicationDataList.size())) {
- throw new IndexOutOfBoundsException("getApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]");
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ * @return the value of the
+ * uk.ac.vamsas.objects.core.ApplicationData at the given index
+ */
+ public uk.ac.vamsas.objects.core.ApplicationData getApplicationData(
+ final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._applicationDataList.size()) {
+ throw new IndexOutOfBoundsException("getApplicationData: Index value '" + index + "' not in range [0.." + (this._applicationDataList.size() - 1) + "]");
}
- return (ApplicationData) _applicationDataList.elementAt(index);
- } //-- ApplicationData getApplicationData(int)
+ return (uk.ac.vamsas.objects.core.ApplicationData) _applicationDataList.get(index);
+ }
/**
- * Method getApplicationData
- *
+ * Method getApplicationData.Returns the contents of the
+ * collection in an Array. <p>Note: Just in case the
+ * collection contents are changing in another thread, we pass
+ * a 0-length Array of the correct type into the API call.
+ * This way we <i>know</i> that the Array returned is of
+ * exactly the correct length.
*
- *
- * @return ApplicationData
+ * @return this collection as an Array
*/
- public ApplicationData[] getApplicationData()
- {
- int size = _applicationDataList.size();
- ApplicationData[] mArray = new ApplicationData[size];
- for (int index = 0; index < size; index++) {
- mArray[index] = (ApplicationData) _applicationDataList.elementAt(index);
- }
- return mArray;
- } //-- ApplicationData[] getApplicationData()
+ public uk.ac.vamsas.objects.core.ApplicationData[] getApplicationData(
+ ) {
+ uk.ac.vamsas.objects.core.ApplicationData[] array = new uk.ac.vamsas.objects.core.ApplicationData[0];
+ return (uk.ac.vamsas.objects.core.ApplicationData[]) this._applicationDataList.toArray(array);
+ }
/**
- * Method getApplicationDataCount
- *
- *
+ * Method getApplicationDataAsReference.Returns a reference to
+ * '_applicationDataList'. No type checking is performed on any
+ * modifications to the Vector.
*
- * @return int
+ * @return a reference to the Vector backing this class
*/
- public int getApplicationDataCount()
- {
- return _applicationDataList.size();
- } //-- int getApplicationDataCount()
+ public java.util.Vector getApplicationDataAsReference(
+ ) {
+ return this._applicationDataList;
+ }
/**
- * Method getAttachment
- *
+ * Method getApplicationDataCount.
*
+ * @return the size of this collection
+ */
+ public int getApplicationDataCount(
+ ) {
+ return this._applicationDataList.size();
+ }
+
+ /**
+ * Method getAttachment.
*
* @param index
- * @return Attachment
- */
- public Attachment getAttachment(int index)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _attachmentList.size())) {
- throw new IndexOutOfBoundsException("getAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]");
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ * @return the value of the
+ * uk.ac.vamsas.objects.core.Attachment at the given index
+ */
+ public uk.ac.vamsas.objects.core.Attachment getAttachment(
+ final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._attachmentList.size()) {
+ throw new IndexOutOfBoundsException("getAttachment: Index value '" + index + "' not in range [0.." + (this._attachmentList.size() - 1) + "]");
}
- return (Attachment) _attachmentList.elementAt(index);
- } //-- Attachment getAttachment(int)
+ return (uk.ac.vamsas.objects.core.Attachment) _attachmentList.get(index);
+ }
/**
- * Method getAttachment
+ * Method getAttachment.Returns the contents of the collection
+ * in an Array. <p>Note: Just in case the collection contents
+ * are changing in another thread, we pass a 0-length Array of
+ * the correct type into the API call. This way we <i>know</i>
+ * that the Array returned is of exactly the correct length.
*
- *
- *
- * @return Attachment
+ * @return this collection as an Array
*/
- public Attachment[] getAttachment()
- {
- int size = _attachmentList.size();
- Attachment[] mArray = new Attachment[size];
- for (int index = 0; index < size; index++) {
- mArray[index] = (Attachment) _attachmentList.elementAt(index);
- }
- return mArray;
- } //-- Attachment[] getAttachment()
+ public uk.ac.vamsas.objects.core.Attachment[] getAttachment(
+ ) {
+ uk.ac.vamsas.objects.core.Attachment[] array = new uk.ac.vamsas.objects.core.Attachment[0];
+ return (uk.ac.vamsas.objects.core.Attachment[]) this._attachmentList.toArray(array);
+ }
/**
- * Method getAttachmentCount
- *
+ * Method getAttachmentAsReference.Returns a reference to
+ * '_attachmentList'. No type checking is performed on any
+ * modifications to the Vector.
*
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getAttachmentAsReference(
+ ) {
+ return this._attachmentList;
+ }
+
+ /**
+ * Method getAttachmentCount.
*
- * @return int
+ * @return the size of this collection
*/
- public int getAttachmentCount()
- {
- return _attachmentList.size();
- } //-- int getAttachmentCount()
+ public int getAttachmentCount(
+ ) {
+ return this._attachmentList.size();
+ }
/**
* Returns the value of field 'lockFile'.
*
- * @return LockFile
- * @return the value of field 'lockFile'.
+ * @return the value of field 'LockFile'.
*/
- public uk.ac.vamsas.objects.core.LockFile getLockFile()
- {
+ public uk.ac.vamsas.objects.core.LockFile getLockFile(
+ ) {
return this._lockFile;
- } //-- uk.ac.vamsas.objects.core.LockFile getLockFile()
+ }
/**
* Returns the value of field 'provenance'.
*
- * @return Provenance
- * @return the value of field 'provenance'.
+ * @return the value of field 'Provenance'.
*/
- public Provenance getProvenance()
- {
+ public uk.ac.vamsas.objects.core.Provenance getProvenance(
+ ) {
return this._provenance;
- } //-- Provenance getProvenance()
+ }
/**
- * Method getVAMSAS
- *
- *
+ * Method getVAMSAS.
*
* @param index
- * @return VAMSAS
- */
- public VAMSAS getVAMSAS(int index)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _VAMSASList.size())) {
- throw new IndexOutOfBoundsException("getVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.VAMSAS at
+ * the given index
+ */
+ public uk.ac.vamsas.objects.core.VAMSAS getVAMSAS(
+ final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._VAMSASList.size()) {
+ throw new IndexOutOfBoundsException("getVAMSAS: Index value '" + index + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]");
}
- return (VAMSAS) _VAMSASList.elementAt(index);
- } //-- VAMSAS getVAMSAS(int)
+ return (uk.ac.vamsas.objects.core.VAMSAS) _VAMSASList.get(index);
+ }
/**
- * Method getVAMSAS
- *
- *
+ * Method getVAMSAS.Returns the contents of the collection in
+ * an Array. <p>Note: Just in case the collection contents
+ * are changing in another thread, we pass a 0-length Array of
+ * the correct type into the API call. This way we <i>know</i>
+ * that the Array returned is of exactly the correct length.
*
- * @return VAMSAS
+ * @return this collection as an Array
*/
- public VAMSAS[] getVAMSAS()
- {
- int size = _VAMSASList.size();
- VAMSAS[] mArray = new VAMSAS[size];
- for (int index = 0; index < size; index++) {
- mArray[index] = (VAMSAS) _VAMSASList.elementAt(index);
- }
- return mArray;
- } //-- VAMSAS[] getVAMSAS()
+ public uk.ac.vamsas.objects.core.VAMSAS[] getVAMSAS(
+ ) {
+ uk.ac.vamsas.objects.core.VAMSAS[] array = new uk.ac.vamsas.objects.core.VAMSAS[0];
+ return (uk.ac.vamsas.objects.core.VAMSAS[]) this._VAMSASList.toArray(array);
+ }
/**
- * Method getVAMSASCount
- *
+ * Method getVAMSASAsReference.Returns a reference to
+ * '_VAMSASList'. No type checking is performed on any
+ * modifications to the Vector.
*
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getVAMSASAsReference(
+ ) {
+ return this._VAMSASList;
+ }
+
+ /**
+ * Method getVAMSASCount.
*
- * @return int
+ * @return the size of this collection
*/
- public int getVAMSASCount()
- {
- return _VAMSASList.size();
- } //-- int getVAMSASCount()
+ public int getVAMSASCount(
+ ) {
+ return this._VAMSASList.size();
+ }
/**
* Returns the value of field 'version'. The field 'version'
* has the following description: Vamsas Document Version
* Number
*
- * @return String
- * @return the value of field 'version'.
+ * @return the value of field 'Version'.
*/
- public java.lang.String getVersion()
- {
+ public java.lang.String getVersion(
+ ) {
return this._version;
- } //-- java.lang.String getVersion()
+ }
/**
- * Method isValid
- *
+ * Overrides the java.lang.Object.hashCode method.
+ * <p>
+ * The following steps came from <b>Effective Java Programming
+ * Language Guide</b> by Joshua Bloch, Chapter 3
*
+ * @return a hash code value for the object.
+ */
+ public int hashCode(
+ ) {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_version != null) {
+ result = 37 * result + _version.hashCode();
+ }
+ if (_lockFile != null) {
+ result = 37 * result + _lockFile.hashCode();
+ }
+ if (_provenance != null) {
+ result = 37 * result + _provenance.hashCode();
+ }
+ if (_VAMSASList != null) {
+ result = 37 * result + _VAMSASList.hashCode();
+ }
+ if (_applicationDataList != null) {
+ result = 37 * result + _applicationDataList.hashCode();
+ }
+ if (_attachmentList != null) {
+ result = 37 * result + _attachmentList.hashCode();
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
*
- * @return boolean
+ * @return true if this object is valid according to the schema
*/
- public boolean isValid()
- {
+ public boolean isValid(
+ ) {
try {
validate();
- }
- catch (org.exolab.castor.xml.ValidationException vex) {
+ } catch (org.exolab.castor.xml.ValidationException vex) {
return false;
}
return true;
- } //-- boolean isValid()
+ }
/**
- * Method marshal
- *
*
*
* @param out
- */
- public void marshal(java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
- {
-
+ * @throws org.exolab.castor.xml.MarshalException if object is
+ * null or if any SAXException is thrown during marshaling
+ * @throws org.exolab.castor.xml.ValidationException if this
+ * object is an invalid instance according to the schema
+ */
+ public void marshal(
+ final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
Marshaller.marshal(this, out);
- } //-- void marshal(java.io.Writer)
+ }
/**
- * Method marshal
- *
*
*
* @param handler
- */
- public void marshal(org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
- {
-
+ * @throws java.io.IOException if an IOException occurs during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException if this
+ * object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException if object is
+ * null or if any SAXException is thrown during marshaling
+ */
+ public void marshal(
+ final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
Marshaller.marshal(this, handler);
- } //-- void marshal(org.xml.sax.ContentHandler)
+ }
/**
- * Method removeAllApplicationData
- *
*/
- public void removeAllApplicationData()
- {
- _applicationDataList.removeAllElements();
- } //-- void removeAllApplicationData()
+ public void removeAllApplicationData(
+ ) {
+ this._applicationDataList.clear();
+ }
/**
- * Method removeAllAttachment
- *
*/
- public void removeAllAttachment()
- {
- _attachmentList.removeAllElements();
- } //-- void removeAllAttachment()
+ public void removeAllAttachment(
+ ) {
+ this._attachmentList.clear();
+ }
/**
- * Method removeAllVAMSAS
- *
*/
- public void removeAllVAMSAS()
- {
- _VAMSASList.removeAllElements();
- } //-- void removeAllVAMSAS()
+ public void removeAllVAMSAS(
+ ) {
+ this._VAMSASList.clear();
+ }
/**
- * Method removeApplicationData
- *
+ * Method removeApplicationData.
*
+ * @param vApplicationData
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeApplicationData(
+ final uk.ac.vamsas.objects.core.ApplicationData vApplicationData) {
+ boolean removed = _applicationDataList.remove(vApplicationData);
+ return removed;
+ }
+
+ /**
+ * Method removeApplicationDataAt.
*
* @param index
- * @return ApplicationData
+ * @return the element removed from the collection
*/
- public ApplicationData removeApplicationData(int index)
- {
- java.lang.Object obj = _applicationDataList.elementAt(index);
- _applicationDataList.removeElementAt(index);
- return (ApplicationData) obj;
- } //-- ApplicationData removeApplicationData(int)
+ public uk.ac.vamsas.objects.core.ApplicationData removeApplicationDataAt(
+ final int index) {
+ java.lang.Object obj = this._applicationDataList.remove(index);
+ return (uk.ac.vamsas.objects.core.ApplicationData) obj;
+ }
/**
- * Method removeAttachment
- *
+ * Method removeAttachment.
*
+ * @param vAttachment
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAttachment(
+ final uk.ac.vamsas.objects.core.Attachment vAttachment) {
+ boolean removed = _attachmentList.remove(vAttachment);
+ return removed;
+ }
+
+ /**
+ * Method removeAttachmentAt.
*
* @param index
- * @return Attachment
+ * @return the element removed from the collection
*/
- public Attachment removeAttachment(int index)
- {
- java.lang.Object obj = _attachmentList.elementAt(index);
- _attachmentList.removeElementAt(index);
- return (Attachment) obj;
- } //-- Attachment removeAttachment(int)
+ public uk.ac.vamsas.objects.core.Attachment removeAttachmentAt(
+ final int index) {
+ java.lang.Object obj = this._attachmentList.remove(index);
+ return (uk.ac.vamsas.objects.core.Attachment) obj;
+ }
/**
- * Method removeVAMSAS
- *
+ * Method removeVAMSAS.
*
+ * @param vVAMSAS
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeVAMSAS(
+ final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS) {
+ boolean removed = _VAMSASList.remove(vVAMSAS);
+ return removed;
+ }
+
+ /**
+ * Method removeVAMSASAt.
*
* @param index
- * @return VAMSAS
+ * @return the element removed from the collection
*/
- public VAMSAS removeVAMSAS(int index)
- {
- java.lang.Object obj = _VAMSASList.elementAt(index);
- _VAMSASList.removeElementAt(index);
- return (VAMSAS) obj;
- } //-- VAMSAS removeVAMSAS(int)
+ public uk.ac.vamsas.objects.core.VAMSAS removeVAMSASAt(
+ final int index) {
+ java.lang.Object obj = this._VAMSASList.remove(index);
+ return (uk.ac.vamsas.objects.core.VAMSAS) obj;
+ }
/**
- * Method setApplicationData
- *
*
*
* @param index
* @param vApplicationData
- */
- public void setApplicationData(int index, ApplicationData vApplicationData)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _applicationDataList.size())) {
- throw new IndexOutOfBoundsException("setApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]");
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void setApplicationData(
+ final int index,
+ final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._applicationDataList.size()) {
+ throw new IndexOutOfBoundsException("setApplicationData: Index value '" + index + "' not in range [0.." + (this._applicationDataList.size() - 1) + "]");
}
- _applicationDataList.setElementAt(vApplicationData, index);
- } //-- void setApplicationData(int, ApplicationData)
+
+ this._applicationDataList.set(index, vApplicationData);
+ }
/**
- * Method setApplicationData
*
*
- *
- * @param applicationDataArray
+ * @param vApplicationDataArray
*/
- public void setApplicationData(ApplicationData[] applicationDataArray)
- {
+ public void setApplicationData(
+ final uk.ac.vamsas.objects.core.ApplicationData[] vApplicationDataArray) {
//-- copy array
- _applicationDataList.removeAllElements();
- for (int i = 0; i < applicationDataArray.length; i++) {
- _applicationDataList.addElement(applicationDataArray[i]);
+ _applicationDataList.clear();
+
+ for (int i = 0; i < vApplicationDataArray.length; i++) {
+ this._applicationDataList.add(vApplicationDataArray[i]);
}
- } //-- void setApplicationData(ApplicationData)
+ }
/**
- * Method setAttachment
+ * Sets the value of '_applicationDataList' by copying the
+ * given Vector. All elements will be checked for type safety.
*
+ * @param vApplicationDataList the Vector to copy.
+ */
+ public void setApplicationData(
+ final java.util.Vector vApplicationDataList) {
+ // copy vector
+ this._applicationDataList.clear();
+
+ this._applicationDataList.addAll(vApplicationDataList);
+ }
+
+ /**
+ * Sets the value of '_applicationDataList' by setting it to
+ * the given Vector. No type checking is performed.
+ * @deprecated
+ *
+ * @param applicationDataVector the Vector to set.
+ */
+ public void setApplicationDataAsReference(
+ final java.util.Vector applicationDataVector) {
+ this._applicationDataList = applicationDataVector;
+ }
+
+ /**
*
*
* @param index
* @param vAttachment
- */
- public void setAttachment(int index, Attachment vAttachment)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _attachmentList.size())) {
- throw new IndexOutOfBoundsException("setAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]");
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void setAttachment(
+ final int index,
+ final uk.ac.vamsas.objects.core.Attachment vAttachment)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._attachmentList.size()) {
+ throw new IndexOutOfBoundsException("setAttachment: Index value '" + index + "' not in range [0.." + (this._attachmentList.size() - 1) + "]");
}
- _attachmentList.setElementAt(vAttachment, index);
- } //-- void setAttachment(int, Attachment)
+
+ this._attachmentList.set(index, vAttachment);
+ }
/**
- * Method setAttachment
- *
*
*
- * @param attachmentArray
+ * @param vAttachmentArray
*/
- public void setAttachment(Attachment[] attachmentArray)
- {
+ public void setAttachment(
+ final uk.ac.vamsas.objects.core.Attachment[] vAttachmentArray) {
//-- copy array
- _attachmentList.removeAllElements();
- for (int i = 0; i < attachmentArray.length; i++) {
- _attachmentList.addElement(attachmentArray[i]);
+ _attachmentList.clear();
+
+ for (int i = 0; i < vAttachmentArray.length; i++) {
+ this._attachmentList.add(vAttachmentArray[i]);
}
- } //-- void setAttachment(Attachment)
+ }
+
+ /**
+ * Sets the value of '_attachmentList' by copying the given
+ * Vector. All elements will be checked for type safety.
+ *
+ * @param vAttachmentList the Vector to copy.
+ */
+ public void setAttachment(
+ final java.util.Vector vAttachmentList) {
+ // copy vector
+ this._attachmentList.clear();
+
+ this._attachmentList.addAll(vAttachmentList);
+ }
+
+ /**
+ * Sets the value of '_attachmentList' by setting it to the
+ * given Vector. No type checking is performed.
+ * @deprecated
+ *
+ * @param attachmentVector the Vector to set.
+ */
+ public void setAttachmentAsReference(
+ final java.util.Vector attachmentVector) {
+ this._attachmentList = attachmentVector;
+ }
/**
* Sets the value of field 'lockFile'.
*
* @param lockFile the value of field 'lockFile'.
*/
- public void setLockFile(uk.ac.vamsas.objects.core.LockFile lockFile)
- {
+ public void setLockFile(
+ final uk.ac.vamsas.objects.core.LockFile lockFile) {
this._lockFile = lockFile;
- } //-- void setLockFile(uk.ac.vamsas.objects.core.LockFile)
+ }
/**
* Sets the value of field 'provenance'.
*
* @param provenance the value of field 'provenance'.
*/
- public void setProvenance(Provenance provenance)
- {
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
this._provenance = provenance;
- } //-- void setProvenance(Provenance)
+ }
/**
- * Method setVAMSAS
- *
*
*
* @param index
* @param vVAMSAS
- */
- public void setVAMSAS(int index, VAMSAS vVAMSAS)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _VAMSASList.size())) {
- throw new IndexOutOfBoundsException("setVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void setVAMSAS(
+ final int index,
+ final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._VAMSASList.size()) {
+ throw new IndexOutOfBoundsException("setVAMSAS: Index value '" + index + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]");
}
- _VAMSASList.setElementAt(vVAMSAS, index);
- } //-- void setVAMSAS(int, VAMSAS)
+
+ this._VAMSASList.set(index, vVAMSAS);
+ }
/**
- * Method setVAMSAS
*
*
- *
- * @param VAMSASArray
+ * @param vVAMSASArray
*/
- public void setVAMSAS(VAMSAS[] VAMSASArray)
- {
+ public void setVAMSAS(
+ final uk.ac.vamsas.objects.core.VAMSAS[] vVAMSASArray) {
//-- copy array
- _VAMSASList.removeAllElements();
- for (int i = 0; i < VAMSASArray.length; i++) {
- _VAMSASList.addElement(VAMSASArray[i]);
+ _VAMSASList.clear();
+
+ for (int i = 0; i < vVAMSASArray.length; i++) {
+ this._VAMSASList.add(vVAMSASArray[i]);
}
- } //-- void setVAMSAS(VAMSAS)
+ }
+
+ /**
+ * Sets the value of '_VAMSASList' by copying the given Vector.
+ * All elements will be checked for type safety.
+ *
+ * @param vVAMSASList the Vector to copy.
+ */
+ public void setVAMSAS(
+ final java.util.Vector vVAMSASList) {
+ // copy vector
+ this._VAMSASList.clear();
+
+ this._VAMSASList.addAll(vVAMSASList);
+ }
+
+ /**
+ * Sets the value of '_VAMSASList' by setting it to the given
+ * Vector. No type checking is performed.
+ * @deprecated
+ *
+ * @param VAMSASVector the Vector to set.
+ */
+ public void setVAMSASAsReference(
+ final java.util.Vector VAMSASVector) {
+ this._VAMSASList = VAMSASVector;
+ }
/**
* Sets the value of field 'version'. The field 'version' has
*
* @param version the value of field 'version'.
*/
- public void setVersion(java.lang.String version)
- {
+ public void setVersion(
+ final java.lang.String version) {
this._version = version;
- } //-- void setVersion(java.lang.String)
+ }
/**
- * Method unmarshal
- *
- *
+ * Method unmarshal.
*
* @param reader
- * @return VamsasDocument
- */
- public static uk.ac.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
- {
+ * @throws org.exolab.castor.xml.MarshalException if object is
+ * null or if any SAXException is thrown during marshaling
+ * @throws org.exolab.castor.xml.ValidationException if this
+ * object is an invalid instance according to the schema
+ * @return the unmarshaled
+ * uk.ac.vamsas.objects.core.VamsasDocument
+ */
+ public static uk.ac.vamsas.objects.core.VamsasDocument unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
return (uk.ac.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.VamsasDocument.class, reader);
- } //-- uk.ac.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader)
+ }
/**
- * Method validate
*
+ *
+ * @throws org.exolab.castor.xml.ValidationException if this
+ * object is an invalid instance according to the schema
*/
- public void validate()
- throws org.exolab.castor.xml.ValidationException
- {
+ public void validate(
+ )
+ throws org.exolab.castor.xml.ValidationException {
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
validator.validate(this);
- } //-- void validate()
+ }
}