/*\r
- * This class was automatically generated with \r
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML\r
- * Schema.\r
- * $Id$\r
+ * This file is part of the Vamsas Client version 0.1. \r
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite, \r
+ * Andrew Waterhouse and Dominik Lindner.\r
+ * \r
+ * Earlier versions have also been incorporated into Jalview version 2.4 \r
+ * since 2008, and TOPALi version 2 since 2007.\r
+ * \r
+ * The Vamsas Client is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published by\r
+ * the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ * \r
+ * The Vamsas Client is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU Lesser General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with the Vamsas Client. If not, see <http://www.gnu.org/licenses/>.\r
*/\r
-\r
package uk.ac.vamsas.objects.core;\r
\r
- //---------------------------------/\r
- //- Imported classes and packages -/\r
+//---------------------------------/\r
+//- Imported classes and packages -/\r
//---------------------------------/\r
\r
import org.exolab.castor.xml.Marshaller;\r
import org.exolab.castor.xml.Unmarshaller;\r
\r
/**\r
- * base type for citing arbitrary links between vamsas objects\r
- * Optional human readable description of the relationship\r
- * \r
+ * base type for citing arbitrary links between vamsas objects Optional human\r
+ * readable description of the relationship\r
+ * \r
* \r
* @version $Revision$ $Date$\r
*/\r
-public class ReferenceType extends uk.ac.vamsas.client.Vobject \r
-implements java.io.Serializable\r
-{\r
-\r
-\r
- //--------------------------/\r
- //- Class/Member Variables -/\r
- //--------------------------/\r
-\r
- /**\r
- * internal content storage\r
- */\r
- private java.lang.String _content = "";\r
-\r
- /**\r
- * Primary Key for vamsas object referencing\r
- * \r
- */\r
- private java.lang.String _id;\r
-\r
- /**\r
- * List of one or more vamsas object\r
- * references\r
- */\r
- private java.util.Vector _refs;\r
-\r
-\r
- //----------------/\r
- //- Constructors -/\r
- //----------------/\r
-\r
- public ReferenceType() {\r
- super();\r
- setContent("");\r
- this._refs = new java.util.Vector();\r
- }\r
-\r
-\r
- //-----------/\r
- //- Methods -/\r
- //-----------/\r
-\r
- /**\r
- * \r
- * \r
- * @param vRefs\r
- * @throws java.lang.IndexOutOfBoundsException if the index\r
- * given is outside the bounds of the collection\r
- */\r
- public void addRefs(\r
- final java.lang.Object vRefs)\r
- throws java.lang.IndexOutOfBoundsException {\r
- this._refs.addElement(vRefs);\r
- }\r
-\r
- /**\r
- * \r
- * \r
- * @param index\r
- * @param vRefs\r
- * @throws java.lang.IndexOutOfBoundsException if the index\r
- * given is outside the bounds of the collection\r
- */\r
- public void addRefs(\r
- final int index,\r
- final java.lang.Object vRefs)\r
- throws java.lang.IndexOutOfBoundsException {\r
- this._refs.add(index, vRefs);\r
- }\r
-\r
- /**\r
- * Method enumerateRefs.\r
- * \r
- * @return an Enumeration over all java.lang.Object elements\r
- */\r
- public java.util.Enumeration enumerateRefs(\r
- ) {\r
- return this._refs.elements();\r
- }\r
-\r
- /**\r
- * Overrides the java.lang.Object.equals method.\r
- * \r
- * @param obj\r
- * @return true if the objects are equal.\r
- */\r
- public boolean equals(\r
- final java.lang.Object obj) {\r
- if ( this == obj )\r
- return true;\r
- \r
- if (super.equals(obj)==false)\r
+public class ReferenceType extends uk.ac.vamsas.client.Vobject implements\r
+ java.io.Serializable {\r
+\r
+ // --------------------------/\r
+ // - Class/Member Variables -/\r
+ // --------------------------/\r
+\r
+ /**\r
+ * internal content storage\r
+ */\r
+ private java.lang.String _content = "";\r
+\r
+ /**\r
+ * Primary Key for vamsas object referencing\r
+ * \r
+ */\r
+ private java.lang.String _id;\r
+\r
+ /**\r
+ * List of one or more vamsas object references\r
+ */\r
+ private java.util.Vector _refs;\r
+\r
+ // ----------------/\r
+ // - Constructors -/\r
+ // ----------------/\r
+\r
+ public ReferenceType() {\r
+ super();\r
+ setContent("");\r
+ this._refs = new java.util.Vector();\r
+ }\r
+\r
+ // -----------/\r
+ // - Methods -/\r
+ // -----------/\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param vRefs\r
+ * @throws java.lang.IndexOutOfBoundsException\r
+ * if the index given is outside the bounds of the collection\r
+ */\r
+ public void addRefs(final java.lang.Object vRefs)\r
+ throws java.lang.IndexOutOfBoundsException {\r
+ this._refs.addElement(vRefs);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param index\r
+ * @param vRefs\r
+ * @throws java.lang.IndexOutOfBoundsException\r
+ * if the index given is outside the bounds of the collection\r
+ */\r
+ public void addRefs(final int index, final java.lang.Object vRefs)\r
+ throws java.lang.IndexOutOfBoundsException {\r
+ this._refs.add(index, vRefs);\r
+ }\r
+\r
+ /**\r
+ * Method enumerateRefs.\r
+ * \r
+ * @return an Enumeration over all java.lang.Object elements\r
+ */\r
+ public java.util.Enumeration enumerateRefs() {\r
+ return this._refs.elements();\r
+ }\r
+\r
+ /**\r
+ * Overrides the java.lang.Object.equals method.\r
+ * \r
+ * @param obj\r
+ * @return true if the objects are equal.\r
+ */\r
+ public boolean equals(final java.lang.Object obj) {\r
+ if (this == obj)\r
+ return true;\r
+\r
+ if (super.equals(obj) == false)\r
+ return false;\r
+\r
+ if (obj instanceof ReferenceType) {\r
+\r
+ ReferenceType temp = (ReferenceType) obj;\r
+ boolean thcycle;\r
+ boolean tmcycle;\r
+ if (this._content != null) {\r
+ if (temp._content == null)\r
+ return false;\r
+ if (this._content != temp._content) {\r
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._content);\r
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._content);\r
+ if (thcycle != tmcycle) {\r
+ if (!thcycle) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);\r
+ }\r
+ ;\r
+ if (!tmcycle) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);\r
+ }\r
+ ;\r
return false;\r
- \r
- if (obj instanceof ReferenceType) {\r
- \r
- ReferenceType temp = (ReferenceType)obj;\r
- boolean thcycle;\r
- boolean tmcycle;\r
- if (this._content != null) {\r
- if (temp._content == null) return false;\r
- if (this._content != temp._content) {\r
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);\r
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);\r
- if (thcycle!=tmcycle) {\r
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };\r
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };\r
- return false;\r
- }\r
- if (!thcycle) {\r
- if (!this._content.equals(temp._content)) {\r
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);\r
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);\r
- return false;\r
- }\r
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);\r
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);\r
- }\r
- }\r
- } else if (temp._content != null)\r
- return false;\r
- if (this._id != null) {\r
- if (temp._id == null) return false;\r
- if (this._id != temp._id) {\r
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);\r
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);\r
- if (thcycle!=tmcycle) {\r
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };\r
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };\r
- return false;\r
- }\r
- if (!thcycle) {\r
- if (!this._id.equals(temp._id)) {\r
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);\r
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);\r
- return false;\r
- }\r
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);\r
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);\r
- }\r
- }\r
- } else if (temp._id != null)\r
- return false;\r
- if (this._refs != null) {\r
- if (temp._refs == null) return false;\r
- if (this._refs != temp._refs) {\r
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._refs);\r
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._refs);\r
- if (thcycle!=tmcycle) {\r
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._refs); };\r
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs); };\r
- return false;\r
- }\r
- if (!thcycle) {\r
- if (!this._refs.equals(temp._refs)) {\r
- org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);\r
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);\r
- return false;\r
- }\r
- org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);\r
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);\r
- }\r
- }\r
- } else if (temp._refs != null)\r
- return false;\r
- return true;\r
+ }\r
+ if (!thcycle) {\r
+ if (!this._content.equals(temp._content)) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);\r
+ return false;\r
+ }\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);\r
+ }\r
}\r
+ } else if (temp._content != null)\r
return false;\r
- }\r
-\r
- /**\r
- * Returns the value of field 'content'. The field 'content'\r
- * has the following description: internal content storage\r
- * \r
- * @return the value of field 'Content'.\r
- */\r
- public java.lang.String getContent(\r
- ) {\r
- return this._content;\r
- }\r
-\r
- /**\r
- * Returns the value of field 'id'. The field 'id' has the\r
- * following description: Primary Key for vamsas object\r
- * referencing\r
- * \r
- * \r
- * @return the value of field 'Id'.\r
- */\r
- public java.lang.String getId(\r
- ) {\r
- return this._id;\r
- }\r
-\r
- /**\r
- * Method getRefs.\r
- * \r
- * @param index\r
- * @throws java.lang.IndexOutOfBoundsException if the index\r
- * given is outside the bounds of the collection\r
- * @return the value of the java.lang.Object at the given index\r
- */\r
- public java.lang.Object getRefs(\r
- final int index)\r
- throws java.lang.IndexOutOfBoundsException {\r
- // check bounds for index\r
- if (index < 0 || index >= this._refs.size()) {\r
- throw new IndexOutOfBoundsException("getRefs: Index value '" + index + "' not in range [0.." + (this._refs.size() - 1) + "]");\r
- }\r
- \r
- return _refs.get(index);\r
- }\r
-\r
- /**\r
- * Method getRefs.Returns the contents of the collection in an\r
- * Array. <p>Note: Just in case the collection contents are\r
- * changing in another thread, we pass a 0-length Array of the\r
- * correct type into the API call. This way we <i>know</i>\r
- * that the Array returned is of exactly the correct length.\r
- * \r
- * @return this collection as an Array\r
- */\r
- public java.lang.Object[] getRefs(\r
- ) {\r
- java.lang.Object[] array = new java.lang.Object[0];\r
- return (java.lang.Object[]) this._refs.toArray(array);\r
- }\r
-\r
- /**\r
- * Method getRefsAsReference.Returns a reference to '_refs'. No\r
- * type checking is performed on any modifications to the\r
- * Vector.\r
- * \r
- * @return a reference to the Vector backing this class\r
- */\r
- public java.util.Vector getRefsAsReference(\r
- ) {\r
- return this._refs;\r
- }\r
-\r
- /**\r
- * Method getRefsCount.\r
- * \r
- * @return the size of this collection\r
- */\r
- public int getRefsCount(\r
- ) {\r
- return this._refs.size();\r
- }\r
-\r
- /**\r
- * Overrides the java.lang.Object.hashCode method.\r
- * <p>\r
- * The following steps came from <b>Effective Java Programming\r
- * Language Guide</b> by Joshua Bloch, Chapter 3\r
- * \r
- * @return a hash code value for the object.\r
- */\r
- public int hashCode(\r
- ) {\r
- int result = super.hashCode();\r
- \r
- long tmp;\r
- if (_content != null\r
- && !org.castor.util.CycleBreaker.startingToCycle(_content)) {\r
- result = 37 * result + _content.hashCode();\r
- org.castor.util.CycleBreaker.releaseCycleHandle(_content);\r
- }\r
- if (_id != null\r
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {\r
- result = 37 * result + _id.hashCode();\r
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);\r
- }\r
- if (_refs != null\r
- && !org.castor.util.CycleBreaker.startingToCycle(_refs)) {\r
- result = 37 * result + _refs.hashCode();\r
- org.castor.util.CycleBreaker.releaseCycleHandle(_refs);\r
+ if (this._id != null) {\r
+ if (temp._id == null)\r
+ return false;\r
+ if (this._id != temp._id) {\r
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);\r
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);\r
+ if (thcycle != tmcycle) {\r
+ if (!thcycle) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);\r
+ }\r
+ ;\r
+ if (!tmcycle) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);\r
+ }\r
+ ;\r
+ return false;\r
+ }\r
+ if (!thcycle) {\r
+ if (!this._id.equals(temp._id)) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);\r
+ return false;\r
+ }\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);\r
+ }\r
}\r
- \r
- return result;\r
- }\r
-\r
- /**\r
- * Method isValid.\r
- * \r
- * @return true if this object is valid according to the schema\r
- */\r
- public boolean isValid(\r
- ) {\r
- try {\r
- validate();\r
- } catch (org.exolab.castor.xml.ValidationException vex) {\r
+ } else if (temp._id != null)\r
+ return false;\r
+ if (this._refs != null) {\r
+ if (temp._refs == null)\r
+ return false;\r
+ if (this._refs != temp._refs) {\r
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._refs);\r
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._refs);\r
+ if (thcycle != tmcycle) {\r
+ if (!thcycle) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);\r
+ }\r
+ ;\r
+ if (!tmcycle) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);\r
+ }\r
+ ;\r
return false;\r
+ }\r
+ if (!thcycle) {\r
+ if (!this._refs.equals(temp._refs)) {\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);\r
+ return false;\r
+ }\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);\r
+ }\r
}\r
- return true;\r
- }\r
-\r
- /**\r
- * \r
- * \r
- * @param out\r
- * @throws org.exolab.castor.xml.MarshalException if object is\r
- * null or if any SAXException is thrown during marshaling\r
- * @throws org.exolab.castor.xml.ValidationException if this\r
- * object is an invalid instance according to the schema\r
- */\r
- public void marshal(\r
- final java.io.Writer out)\r
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
- Marshaller.marshal(this, out);\r
- }\r
-\r
- /**\r
- * \r
- * \r
- * @param handler\r
- * @throws java.io.IOException if an IOException occurs during\r
- * marshaling\r
- * @throws org.exolab.castor.xml.ValidationException if this\r
- * object is an invalid instance according to the schema\r
- * @throws org.exolab.castor.xml.MarshalException if object is\r
- * null or if any SAXException is thrown during marshaling\r
- */\r
- public void marshal(\r
- final org.xml.sax.ContentHandler handler)\r
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
- Marshaller.marshal(this, handler);\r
- }\r
-\r
- /**\r
- */\r
- public void removeAllRefs(\r
- ) {\r
- this._refs.clear();\r
+ } else if (temp._refs != null)\r
+ return false;\r
+ return true;\r
}\r
-\r
- /**\r
- * Method removeRefs.\r
- * \r
- * @param vRefs\r
- * @return true if the object was removed from the collection.\r
- */\r
- public boolean removeRefs(\r
- final java.lang.Object vRefs) {\r
- boolean removed = _refs.remove(vRefs);\r
- return removed;\r
+ return false;\r
+ }\r
+\r
+ /**\r
+ * Returns the value of field 'content'. The field 'content' has the following\r
+ * description: internal content storage\r
+ * \r
+ * @return the value of field 'Content'.\r
+ */\r
+ public java.lang.String getContent() {\r
+ return this._content;\r
+ }\r
+\r
+ /**\r
+ * Returns the value of field 'id'. The field 'id' has the following\r
+ * description: Primary Key for vamsas object referencing\r
+ * \r
+ * \r
+ * @return the value of field 'Id'.\r
+ */\r
+ public java.lang.String getId() {\r
+ return this._id;\r
+ }\r
+\r
+ /**\r
+ * Method getRefs.\r
+ * \r
+ * @param index\r
+ * @throws java.lang.IndexOutOfBoundsException\r
+ * if the index given is outside the bounds of the collection\r
+ * @return the value of the java.lang.Object at the given index\r
+ */\r
+ public java.lang.Object getRefs(final int index)\r
+ throws java.lang.IndexOutOfBoundsException {\r
+ // check bounds for index\r
+ if (index < 0 || index >= this._refs.size()) {\r
+ throw new IndexOutOfBoundsException("getRefs: Index value '" + index\r
+ + "' not in range [0.." + (this._refs.size() - 1) + "]");\r
}\r
\r
- /**\r
- * Method removeRefsAt.\r
- * \r
- * @param index\r
- * @return the element removed from the collection\r
- */\r
- public java.lang.Object removeRefsAt(\r
- final int index) {\r
- java.lang.Object obj = this._refs.remove(index);\r
- return obj;\r
+ return _refs.get(index);\r
+ }\r
+\r
+ /**\r
+ * Method getRefs.Returns the contents of the collection in an Array.\r
+ * <p>\r
+ * Note: Just in case the collection contents are changing in another thread,\r
+ * we pass a 0-length Array of the correct type into the API call. This way we\r
+ * <i>know</i> that the Array returned is of exactly the correct length.\r
+ * \r
+ * @return this collection as an Array\r
+ */\r
+ public java.lang.Object[] getRefs() {\r
+ java.lang.Object[] array = new java.lang.Object[0];\r
+ return (java.lang.Object[]) this._refs.toArray(array);\r
+ }\r
+\r
+ /**\r
+ * Method getRefsAsReference.Returns a reference to '_refs'. No type checking\r
+ * is performed on any modifications to the Vector.\r
+ * \r
+ * @return a reference to the Vector backing this class\r
+ */\r
+ public java.util.Vector getRefsAsReference() {\r
+ return this._refs;\r
+ }\r
+\r
+ /**\r
+ * Method getRefsCount.\r
+ * \r
+ * @return the size of this collection\r
+ */\r
+ public int getRefsCount() {\r
+ return this._refs.size();\r
+ }\r
+\r
+ /**\r
+ * Overrides the java.lang.Object.hashCode method.\r
+ * <p>\r
+ * The following steps came from <b>Effective Java Programming Language\r
+ * Guide</b> by Joshua Bloch, Chapter 3\r
+ * \r
+ * @return a hash code value for the object.\r
+ */\r
+ public int hashCode() {\r
+ int result = super.hashCode();\r
+\r
+ long tmp;\r
+ if (_content != null\r
+ && !org.castor.util.CycleBreaker.startingToCycle(_content)) {\r
+ result = 37 * result + _content.hashCode();\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(_content);\r
}\r
-\r
- /**\r
- * Sets the value of field 'content'. The field 'content' has\r
- * the following description: internal content storage\r
- * \r
- * @param content the value of field 'content'.\r
- */\r
- public void setContent(\r
- final java.lang.String content) {\r
- this._content = content;\r
- }\r
-\r
- /**\r
- * Sets the value of field 'id'. The field 'id' has the\r
- * following description: Primary Key for vamsas object\r
- * referencing\r
- * \r
- * \r
- * @param id the value of field 'id'.\r
- */\r
- public void setId(\r
- final java.lang.String id) {\r
- this._id = id;\r
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {\r
+ result = 37 * result + _id.hashCode();\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);\r
}\r
-\r
- /**\r
- * \r
- * \r
- * @param index\r
- * @param vRefs\r
- * @throws java.lang.IndexOutOfBoundsException if the index\r
- * given is outside the bounds of the collection\r
- */\r
- public void setRefs(\r
- final int index,\r
- final java.lang.Object vRefs)\r
- throws java.lang.IndexOutOfBoundsException {\r
- // check bounds for index\r
- if (index < 0 || index >= this._refs.size()) {\r
- throw new IndexOutOfBoundsException("setRefs: Index value '" + index + "' not in range [0.." + (this._refs.size() - 1) + "]");\r
- }\r
- \r
- this._refs.set(index, vRefs);\r
+ if (_refs != null && !org.castor.util.CycleBreaker.startingToCycle(_refs)) {\r
+ result = 37 * result + _refs.hashCode();\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(_refs);\r
}\r
\r
- /**\r
- * \r
- * \r
- * @param vRefsArray\r
- */\r
- public void setRefs(\r
- final java.lang.Object[] vRefsArray) {\r
- //-- copy array\r
- _refs.clear();\r
- \r
- for (int i = 0; i < vRefsArray.length; i++) {\r
- this._refs.add(vRefsArray[i]);\r
- }\r
+ return result;\r
+ }\r
+\r
+ /**\r
+ * Method isValid.\r
+ * \r
+ * @return true if this object is valid according to the schema\r
+ */\r
+ public boolean isValid() {\r
+ try {\r
+ validate();\r
+ } catch (org.exolab.castor.xml.ValidationException vex) {\r
+ return false;\r
}\r
-\r
- /**\r
- * Sets the value of '_refs' by copying the given Vector. All\r
- * elements will be checked for type safety.\r
- * \r
- * @param vRefsList the Vector to copy.\r
+ return true;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param out\r
+ * @throws org.exolab.castor.xml.MarshalException\r
+ * if object is null or if any SAXException is thrown during\r
+ * marshaling\r
+ * @throws org.exolab.castor.xml.ValidationException\r
+ * if this object is an invalid instance according to the schema\r
+ */\r
+ public void marshal(final java.io.Writer out)\r
+ throws org.exolab.castor.xml.MarshalException,\r
+ org.exolab.castor.xml.ValidationException {\r
+ Marshaller.marshal(this, out);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param handler\r
+ * @throws java.io.IOException\r
+ * if an IOException occurs during marshaling\r
+ * @throws org.exolab.castor.xml.ValidationException\r
+ * if this object is an invalid instance according to the schema\r
+ * @throws org.exolab.castor.xml.MarshalException\r
+ * if object is null or if any SAXException is thrown during\r
+ * marshaling\r
+ */\r
+ public void marshal(final org.xml.sax.ContentHandler handler)\r
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,\r
+ org.exolab.castor.xml.ValidationException {\r
+ Marshaller.marshal(this, handler);\r
+ }\r
+\r
+ /**\r
*/\r
- public void setRefs(\r
- final java.util.Vector vRefsList) {\r
- // copy vector\r
- this._refs.clear();\r
- \r
- this._refs.addAll(vRefsList);\r
+ public void removeAllRefs() {\r
+ this._refs.clear();\r
+ }\r
+\r
+ /**\r
+ * Method removeRefs.\r
+ * \r
+ * @param vRefs\r
+ * @return true if the object was removed from the collection.\r
+ */\r
+ public boolean removeRefs(final java.lang.Object vRefs) {\r
+ boolean removed = _refs.remove(vRefs);\r
+ return removed;\r
+ }\r
+\r
+ /**\r
+ * Method removeRefsAt.\r
+ * \r
+ * @param index\r
+ * @return the element removed from the collection\r
+ */\r
+ public java.lang.Object removeRefsAt(final int index) {\r
+ java.lang.Object obj = this._refs.remove(index);\r
+ return obj;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of field 'content'. The field 'content' has the following\r
+ * description: internal content storage\r
+ * \r
+ * @param content\r
+ * the value of field 'content'.\r
+ */\r
+ public void setContent(final java.lang.String content) {\r
+ this._content = content;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of field 'id'. The field 'id' has the following description:\r
+ * Primary Key for vamsas object referencing\r
+ * \r
+ * \r
+ * @param id\r
+ * the value of field 'id'.\r
+ */\r
+ public void setId(final java.lang.String id) {\r
+ this._id = id;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param index\r
+ * @param vRefs\r
+ * @throws java.lang.IndexOutOfBoundsException\r
+ * if the index given is outside the bounds of the collection\r
+ */\r
+ public void setRefs(final int index, final java.lang.Object vRefs)\r
+ throws java.lang.IndexOutOfBoundsException {\r
+ // check bounds for index\r
+ if (index < 0 || index >= this._refs.size()) {\r
+ throw new IndexOutOfBoundsException("setRefs: Index value '" + index\r
+ + "' not in range [0.." + (this._refs.size() - 1) + "]");\r
}\r
\r
- /**\r
- * Sets the value of '_refs' by setting it to the given Vector.\r
- * No type checking is performed.\r
- * @deprecated\r
- * \r
- * @param refsVector the Vector to set.\r
- */\r
- public void setRefsAsReference(\r
- final java.util.Vector refsVector) {\r
- this._refs = refsVector;\r
- }\r
+ this._refs.set(index, vRefs);\r
+ }\r
\r
- /**\r
- * Method unmarshal.\r
- * \r
- * @param reader\r
- * @throws org.exolab.castor.xml.MarshalException if object is\r
- * null or if any SAXException is thrown during marshaling\r
- * @throws org.exolab.castor.xml.ValidationException if this\r
- * object is an invalid instance according to the schema\r
- * @return the unmarshaled\r
- * uk.ac.vamsas.objects.core.ReferenceType\r
- */\r
- public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(\r
- final java.io.Reader reader)\r
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
- return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.ReferenceType.class, reader);\r
- }\r
+ /**\r
+ * \r
+ * \r
+ * @param vRefsArray\r
+ */\r
+ public void setRefs(final java.lang.Object[] vRefsArray) {\r
+ // -- copy array\r
+ _refs.clear();\r
\r
- /**\r
- * \r
- * \r
- * @throws org.exolab.castor.xml.ValidationException if this\r
- * object is an invalid instance according to the schema\r
- */\r
- public void validate(\r
- )\r
- throws org.exolab.castor.xml.ValidationException {\r
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
- validator.validate(this);\r
+ for (int i = 0; i < vRefsArray.length; i++) {\r
+ this._refs.add(vRefsArray[i]);\r
}\r
+ }\r
+\r
+ /**\r
+ * Sets the value of '_refs' by copying the given Vector. All elements will be\r
+ * checked for type safety.\r
+ * \r
+ * @param vRefsList\r
+ * the Vector to copy.\r
+ */\r
+ public void setRefs(final java.util.Vector vRefsList) {\r
+ // copy vector\r
+ this._refs.clear();\r
+\r
+ this._refs.addAll(vRefsList);\r
+ }\r
+\r
+ /**\r
+ * Sets the value of '_refs' by setting it to the given Vector. No type\r
+ * checking is performed.\r
+ * \r
+ * @deprecated\r
+ * \r
+ * @param refsVector\r
+ * the Vector to set.\r
+ */\r
+ public void setRefsAsReference(final java.util.Vector refsVector) {\r
+ this._refs = refsVector;\r
+ }\r
+\r
+ /**\r
+ * Method unmarshal.\r
+ * \r
+ * @param reader\r
+ * @throws org.exolab.castor.xml.MarshalException\r
+ * if object is null or if any SAXException is thrown during\r
+ * marshaling\r
+ * @throws org.exolab.castor.xml.ValidationException\r
+ * if this object is an invalid instance according to the schema\r
+ * @return the unmarshaled uk.ac.vamsas.objects.core.ReferenceType\r
+ */\r
+ public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(\r
+ final java.io.Reader reader)\r
+ throws org.exolab.castor.xml.MarshalException,\r
+ org.exolab.castor.xml.ValidationException {\r
+ return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(\r
+ uk.ac.vamsas.objects.core.ReferenceType.class, reader);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @throws org.exolab.castor.xml.ValidationException\r
+ * if this object is an invalid instance according to the schema\r
+ */\r
+ public void validate() throws org.exolab.castor.xml.ValidationException {\r
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
+ validator.validate(this);\r
+ }\r
\r
}\r