+ } else if (temp._segList != null)\r
+ return false;\r
+ return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ /**\r
+ * Returns the value of field 'choiceValue'. The field 'choiceValue' has the\r
+ * following description: Internal choice value storage\r
+ * \r
+ * @return the value of field 'ChoiceValue'.\r
+ */\r
+ public java.lang.Object getChoiceValue() {\r
+ return this._choiceValue;\r
+ }\r
+\r
+ /**\r
+ * Method getPos.\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 uk.ac.vamsas.objects.core.Pos at the given index\r
+ */\r
+ public uk.ac.vamsas.objects.core.Pos getPos(final int index)\r
+ throws java.lang.IndexOutOfBoundsException {\r
+ // check bounds for index\r
+ if (index < 0 || index >= this._posList.size()) {\r
+ throw new IndexOutOfBoundsException("getPos: Index value '" + index\r
+ + "' not in range [0.." + (this._posList.size() - 1) + "]");\r
+ }\r
+\r
+ return (uk.ac.vamsas.objects.core.Pos) _posList.get(index);\r
+ }\r
+\r
+ /**\r
+ * Method getPos.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 uk.ac.vamsas.objects.core.Pos[] getPos() {\r
+ uk.ac.vamsas.objects.core.Pos[] array = new uk.ac.vamsas.objects.core.Pos[0];\r
+ return (uk.ac.vamsas.objects.core.Pos[]) this._posList.toArray(array);\r
+ }\r
+\r
+ /**\r
+ * Method getPosAsReference.Returns a reference to '_posList'. No type\r
+ * checking 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 getPosAsReference() {\r
+ return this._posList;\r
+ }\r
+\r
+ /**\r
+ * Method getPosCount.\r
+ * \r
+ * @return the size of this collection\r
+ */\r
+ public int getPosCount() {\r
+ return this._posList.size();\r
+ }\r
+\r
+ /**\r
+ * Method getSeg.\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 uk.ac.vamsas.objects.core.Seg at the given index\r
+ */\r
+ public uk.ac.vamsas.objects.core.Seg getSeg(final int index)\r
+ throws java.lang.IndexOutOfBoundsException {\r
+ // check bounds for index\r
+ if (index < 0 || index >= this._segList.size()) {\r
+ throw new IndexOutOfBoundsException("getSeg: Index value '" + index\r
+ + "' not in range [0.." + (this._segList.size() - 1) + "]");\r
+ }\r
+\r
+ return (uk.ac.vamsas.objects.core.Seg) _segList.get(index);\r
+ }\r
+\r
+ /**\r
+ * Method getSeg.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 uk.ac.vamsas.objects.core.Seg[] getSeg() {\r
+ uk.ac.vamsas.objects.core.Seg[] array = new uk.ac.vamsas.objects.core.Seg[0];\r
+ return (uk.ac.vamsas.objects.core.Seg[]) this._segList.toArray(array);\r
+ }\r
+\r
+ /**\r
+ * Method getSegAsReference.Returns a reference to '_segList'. No type\r
+ * checking 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 getSegAsReference() {\r
+ return this._segList;\r
+ }\r
+\r
+ /**\r
+ * Method getSegCount.\r
+ * \r
+ * @return the size of this collection\r
+ */\r
+ public int getSegCount() {\r
+ return this._segList.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 (_choiceValue != null\r
+ && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) {\r
+ result = 37 * result + _choiceValue.hashCode();\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue);\r
+ }\r
+ if (_posList != null\r
+ && !org.castor.util.CycleBreaker.startingToCycle(_posList)) {\r
+ result = 37 * result + _posList.hashCode();\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(_posList);\r
+ }\r
+ if (_segList != null\r
+ && !org.castor.util.CycleBreaker.startingToCycle(_segList)) {\r
+ result = 37 * result + _segList.hashCode();\r
+ org.castor.util.CycleBreaker.releaseCycleHandle(_segList);\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
+ try {\r
+ validate();\r
+ } catch (org.exolab.castor.xml.ValidationException vex) {\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ /**\r
+ */\r
+ public void removeAllPos() {\r
+ this._posList.clear();\r
+ }\r
+\r
+ /**\r
+ */\r
+ public void removeAllSeg() {\r
+ this._segList.clear();\r
+ }\r
+\r
+ /**\r
+ * Method removePos.\r
+ * \r
+ * @param vPos\r
+ * @return true if the object was removed from the collection.\r
+ */\r
+ public boolean removePos(final uk.ac.vamsas.objects.core.Pos vPos) {\r
+ boolean removed = _posList.remove(vPos);\r
+ return removed;\r
+ }\r
+\r
+ /**\r
+ * Method removePosAt.\r
+ * \r
+ * @param index\r
+ * @return the element removed from the collection\r
+ */\r
+ public uk.ac.vamsas.objects.core.Pos removePosAt(final int index) {\r
+ java.lang.Object obj = this._posList.remove(index);\r
+ return (uk.ac.vamsas.objects.core.Pos) obj;\r
+ }\r
+\r
+ /**\r
+ * Method removeSeg.\r
+ * \r
+ * @param vSeg\r
+ * @return true if the object was removed from the collection.\r
+ */\r
+ public boolean removeSeg(final uk.ac.vamsas.objects.core.Seg vSeg) {\r
+ boolean removed = _segList.remove(vSeg);\r
+ return removed;\r
+ }\r
+\r
+ /**\r
+ * Method removeSegAt.\r
+ * \r
+ * @param index\r
+ * @return the element removed from the collection\r
+ */\r
+ public uk.ac.vamsas.objects.core.Seg removeSegAt(final int index) {\r
+ java.lang.Object obj = this._segList.remove(index);\r
+ return (uk.ac.vamsas.objects.core.Seg) obj;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param index\r
+ * @param vPos\r
+ * @throws java.lang.IndexOutOfBoundsException\r
+ * if the index given is outside the bounds of the collection\r
+ */\r
+ public void setPos(final int index, final uk.ac.vamsas.objects.core.Pos vPos)\r
+ throws java.lang.IndexOutOfBoundsException {\r
+ // check bounds for index\r
+ if (index < 0 || index >= this._posList.size()) {\r
+ throw new IndexOutOfBoundsException("setPos: Index value '" + index\r
+ + "' not in range [0.." + (this._posList.size() - 1) + "]");\r
+ }\r
+\r
+ this._posList.set(index, vPos);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param vPosArray\r
+ */\r
+ public void setPos(final uk.ac.vamsas.objects.core.Pos[] vPosArray) {\r
+ // -- copy array\r
+ _posList.clear();\r
+\r
+ for (int i = 0; i < vPosArray.length; i++) {\r
+ this._posList.add(vPosArray[i]);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of '_posList' by copying the given Vector. All elements will\r
+ * be checked for type safety.\r
+ * \r
+ * @param vPosList\r
+ * the Vector to copy.\r
+ */\r
+ public void setPos(final java.util.Vector vPosList) {\r
+ // copy vector\r
+ this._posList.clear();\r
+\r
+ this._posList.addAll(vPosList);\r
+ }\r
+\r
+ /**\r
+ * Sets the value of '_posList' by setting it to the given Vector. No type\r
+ * checking is performed.\r
+ * \r
+ * @deprecated\r
+ * \r
+ * @param posVector\r
+ * the Vector to set.\r
+ */\r
+ public void setPosAsReference(final java.util.Vector posVector) {\r
+ this._posList = posVector;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param index\r
+ * @param vSeg\r
+ * @throws java.lang.IndexOutOfBoundsException\r
+ * if the index given is outside the bounds of the collection\r
+ */\r
+ public void setSeg(final int index, final uk.ac.vamsas.objects.core.Seg vSeg)\r
+ throws java.lang.IndexOutOfBoundsException {\r
+ // check bounds for index\r
+ if (index < 0 || index >= this._segList.size()) {\r
+ throw new IndexOutOfBoundsException("setSeg: Index value '" + index\r
+ + "' not in range [0.." + (this._segList.size() - 1) + "]");\r
+ }\r
+\r
+ this._segList.set(index, vSeg);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * \r
+ * @param vSegArray\r
+ */\r
+ public void setSeg(final uk.ac.vamsas.objects.core.Seg[] vSegArray) {\r
+ // -- copy array\r
+ _segList.clear();\r
+\r
+ for (int i = 0; i < vSegArray.length; i++) {\r
+ this._segList.add(vSegArray[i]);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of '_segList' by copying the given Vector. All elements will\r
+ * be checked for type safety.\r
+ * \r
+ * @param vSegList\r
+ * the Vector to copy.\r
+ */\r
+ public void setSeg(final java.util.Vector vSegList) {\r
+ // copy vector\r
+ this._segList.clear();\r
+\r
+ this._segList.addAll(vSegList);\r
+ }\r
+\r
+ /**\r
+ * Sets the value of '_segList' by setting it to the given Vector. No type\r
+ * checking is performed.\r
+ * \r
+ * @deprecated\r
+ * \r
+ * @param segVector\r
+ * the Vector to set.\r
+ */\r
+ public void setSegAsReference(final java.util.Vector segVector) {\r
+ this._segList = segVector;\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