X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fbinding%2FJalviewModelSequence.java;h=66b424ff36aad7c37358ad8eb626ed80c53b8618;hb=dfa04e77181fccfa6229ffef1591fc9c622d9b39;hp=d22dcd464a488caad4f3eb23f44b625f8ea4ca9b;hpb=99c58ee0ae2a848f982552e53feaf6d5cb9925e5;p=jalview.git
diff --git a/src/jalview/binding/JalviewModelSequence.java b/src/jalview/binding/JalviewModelSequence.java
old mode 100755
new mode 100644
index d22dcd4..66b424f
--- a/src/jalview/binding/JalviewModelSequence.java
+++ b/src/jalview/binding/JalviewModelSequence.java
@@ -1,746 +1,966 @@
-/*
- * This class was automatically generated with
- * Castor 0.9.6, using an XML
- * Schema.
- * $Id$
- */
-
-/*
-* Jalview - A Sequence Alignment Editor and Viewer
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-*/
-
-package jalview.binding;
-
- //---------------------------------/
- //- 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 JalviewModelSequence.
- *
- * @version $Revision$ $Date$
- */
-public class JalviewModelSequence implements java.io.Serializable {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _JSeqList
- */
- private java.util.Vector _JSeqList;
-
- /**
- * Field _JGroupList
- */
- private java.util.Vector _JGroupList;
-
- /**
- * Field _viewportList
- */
- private java.util.Vector _viewportList;
-
- /**
- * Field _userColoursList
- */
- private java.util.Vector _userColoursList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public JalviewModelSequence() {
- super();
- _JSeqList = new Vector();
- _JGroupList = new Vector();
- _viewportList = new Vector();
- _userColoursList = new Vector();
- } //-- jalview.binding.JalviewModelSequence()
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method addJGroup
- *
- *
- *
- * @param vJGroup
- */
- public void addJGroup(jalview.binding.JGroup vJGroup)
- throws java.lang.IndexOutOfBoundsException
- {
- _JGroupList.addElement(vJGroup);
- } //-- void addJGroup(jalview.binding.JGroup)
-
- /**
- * Method addJGroup
- *
- *
- *
- * @param index
- * @param vJGroup
- */
- public void addJGroup(int index, jalview.binding.JGroup vJGroup)
- throws java.lang.IndexOutOfBoundsException
- {
- _JGroupList.insertElementAt(vJGroup, index);
- } //-- void addJGroup(int, jalview.binding.JGroup)
-
- /**
- * Method addJSeq
- *
- *
- *
- * @param vJSeq
- */
- public void addJSeq(jalview.binding.JSeq vJSeq)
- throws java.lang.IndexOutOfBoundsException
- {
- _JSeqList.addElement(vJSeq);
- } //-- void addJSeq(jalview.binding.JSeq)
-
- /**
- * Method addJSeq
- *
- *
- *
- * @param index
- * @param vJSeq
- */
- public void addJSeq(int index, jalview.binding.JSeq vJSeq)
- throws java.lang.IndexOutOfBoundsException
- {
- _JSeqList.insertElementAt(vJSeq, index);
- } //-- void addJSeq(int, jalview.binding.JSeq)
-
- /**
- * Method addUserColours
- *
- *
- *
- * @param vUserColours
- */
- public void addUserColours(jalview.binding.UserColours vUserColours)
- throws java.lang.IndexOutOfBoundsException
- {
- _userColoursList.addElement(vUserColours);
- } //-- void addUserColours(jalview.binding.UserColours)
-
- /**
- * Method addUserColours
- *
- *
- *
- * @param index
- * @param vUserColours
- */
- public void addUserColours(int index, jalview.binding.UserColours vUserColours)
- throws java.lang.IndexOutOfBoundsException
- {
- _userColoursList.insertElementAt(vUserColours, index);
- } //-- void addUserColours(int, jalview.binding.UserColours)
-
- /**
- * Method addViewport
- *
- *
- *
- * @param vViewport
- */
- public void addViewport(jalview.binding.Viewport vViewport)
- throws java.lang.IndexOutOfBoundsException
- {
- _viewportList.addElement(vViewport);
- } //-- void addViewport(jalview.binding.Viewport)
-
- /**
- * Method addViewport
- *
- *
- *
- * @param index
- * @param vViewport
- */
- public void addViewport(int index, jalview.binding.Viewport vViewport)
- throws java.lang.IndexOutOfBoundsException
- {
- _viewportList.insertElementAt(vViewport, index);
- } //-- void addViewport(int, jalview.binding.Viewport)
-
- /**
- * Method enumerateJGroup
- *
- *
- *
- * @return Enumeration
- */
- public java.util.Enumeration enumerateJGroup()
- {
- return _JGroupList.elements();
- } //-- java.util.Enumeration enumerateJGroup()
-
- /**
- * Method enumerateJSeq
- *
- *
- *
- * @return Enumeration
- */
- public java.util.Enumeration enumerateJSeq()
- {
- return _JSeqList.elements();
- } //-- java.util.Enumeration enumerateJSeq()
-
- /**
- * Method enumerateUserColours
- *
- *
- *
- * @return Enumeration
- */
- public java.util.Enumeration enumerateUserColours()
- {
- return _userColoursList.elements();
- } //-- java.util.Enumeration enumerateUserColours()
-
- /**
- * Method enumerateViewport
- *
- *
- *
- * @return Enumeration
- */
- public java.util.Enumeration enumerateViewport()
- {
- return _viewportList.elements();
- } //-- java.util.Enumeration enumerateViewport()
-
- /**
- * Method getJGroup
- *
- *
- *
- * @param index
- * @return JGroup
- */
- public jalview.binding.JGroup getJGroup(int index)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _JGroupList.size())) {
- throw new IndexOutOfBoundsException();
- }
-
- return (jalview.binding.JGroup) _JGroupList.elementAt(index);
- } //-- jalview.binding.JGroup getJGroup(int)
-
- /**
- * Method getJGroup
- *
- *
- *
- * @return JGroup
- */
- public jalview.binding.JGroup[] getJGroup()
- {
- int size = _JGroupList.size();
- jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];
- for (int index = 0; index < size; index++) {
- mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);
- }
- return mArray;
- } //-- jalview.binding.JGroup[] getJGroup()
-
- /**
- * Method getJGroupCount
- *
- *
- *
- * @return int
- */
- public int getJGroupCount()
- {
- return _JGroupList.size();
- } //-- int getJGroupCount()
-
- /**
- * Method getJSeq
- *
- *
- *
- * @param index
- * @return JSeq
- */
- public jalview.binding.JSeq getJSeq(int index)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _JSeqList.size())) {
- throw new IndexOutOfBoundsException();
- }
-
- return (jalview.binding.JSeq) _JSeqList.elementAt(index);
- } //-- jalview.binding.JSeq getJSeq(int)
-
- /**
- * Method getJSeq
- *
- *
- *
- * @return JSeq
- */
- public jalview.binding.JSeq[] getJSeq()
- {
- int size = _JSeqList.size();
- jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];
- for (int index = 0; index < size; index++) {
- mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);
- }
- return mArray;
- } //-- jalview.binding.JSeq[] getJSeq()
-
- /**
- * Method getJSeqCount
- *
- *
- *
- * @return int
- */
- public int getJSeqCount()
- {
- return _JSeqList.size();
- } //-- int getJSeqCount()
-
- /**
- * Method getUserColours
- *
- *
- *
- * @param index
- * @return UserColours
- */
- public jalview.binding.UserColours getUserColours(int index)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _userColoursList.size())) {
- throw new IndexOutOfBoundsException();
- }
-
- return (jalview.binding.UserColours) _userColoursList.elementAt(index);
- } //-- jalview.binding.UserColours getUserColours(int)
-
- /**
- * Method getUserColours
- *
- *
- *
- * @return UserColours
- */
- public jalview.binding.UserColours[] getUserColours()
- {
- int size = _userColoursList.size();
- jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size];
- for (int index = 0; index < size; index++) {
- mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index);
- }
- return mArray;
- } //-- jalview.binding.UserColours[] getUserColours()
-
- /**
- * Method getUserColoursCount
- *
- *
- *
- * @return int
- */
- public int getUserColoursCount()
- {
- return _userColoursList.size();
- } //-- int getUserColoursCount()
-
- /**
- * Method getViewport
- *
- *
- *
- * @param index
- * @return Viewport
- */
- public jalview.binding.Viewport getViewport(int index)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _viewportList.size())) {
- throw new IndexOutOfBoundsException();
- }
-
- return (jalview.binding.Viewport) _viewportList.elementAt(index);
- } //-- jalview.binding.Viewport getViewport(int)
-
- /**
- * Method getViewport
- *
- *
- *
- * @return Viewport
- */
- public jalview.binding.Viewport[] getViewport()
- {
- int size = _viewportList.size();
- jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];
- for (int index = 0; index < size; index++) {
- mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);
- }
- return mArray;
- } //-- jalview.binding.Viewport[] getViewport()
-
- /**
- * Method getViewportCount
- *
- *
- *
- * @return int
- */
- public int getViewportCount()
- {
- return _viewportList.size();
- } //-- int getViewportCount()
-
- /**
- * Method isValid
- *
- *
- *
- * @return boolean
- */
- public boolean isValid()
- {
- try {
- validate();
- }
- 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
- {
-
- 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
- {
-
- Marshaller.marshal(this, handler);
- } //-- void marshal(org.xml.sax.ContentHandler)
-
- /**
- * Method removeAllJGroup
- *
- */
- public void removeAllJGroup()
- {
- _JGroupList.removeAllElements();
- } //-- void removeAllJGroup()
-
- /**
- * Method removeAllJSeq
- *
- */
- public void removeAllJSeq()
- {
- _JSeqList.removeAllElements();
- } //-- void removeAllJSeq()
-
- /**
- * Method removeAllUserColours
- *
- */
- public void removeAllUserColours()
- {
- _userColoursList.removeAllElements();
- } //-- void removeAllUserColours()
-
- /**
- * Method removeAllViewport
- *
- */
- public void removeAllViewport()
- {
- _viewportList.removeAllElements();
- } //-- void removeAllViewport()
-
- /**
- * Method removeJGroup
- *
- *
- *
- * @param index
- * @return JGroup
- */
- public jalview.binding.JGroup removeJGroup(int index)
- {
- java.lang.Object obj = _JGroupList.elementAt(index);
- _JGroupList.removeElementAt(index);
- return (jalview.binding.JGroup) obj;
- } //-- jalview.binding.JGroup removeJGroup(int)
-
- /**
- * Method removeJSeq
- *
- *
- *
- * @param index
- * @return JSeq
- */
- public jalview.binding.JSeq removeJSeq(int index)
- {
- java.lang.Object obj = _JSeqList.elementAt(index);
- _JSeqList.removeElementAt(index);
- return (jalview.binding.JSeq) obj;
- } //-- jalview.binding.JSeq removeJSeq(int)
-
- /**
- * Method removeUserColours
- *
- *
- *
- * @param index
- * @return UserColours
- */
- public jalview.binding.UserColours removeUserColours(int index)
- {
- java.lang.Object obj = _userColoursList.elementAt(index);
- _userColoursList.removeElementAt(index);
- return (jalview.binding.UserColours) obj;
- } //-- jalview.binding.UserColours removeUserColours(int)
-
- /**
- * Method removeViewport
- *
- *
- *
- * @param index
- * @return Viewport
- */
- public jalview.binding.Viewport removeViewport(int index)
- {
- java.lang.Object obj = _viewportList.elementAt(index);
- _viewportList.removeElementAt(index);
- return (jalview.binding.Viewport) obj;
- } //-- jalview.binding.Viewport removeViewport(int)
-
- /**
- * Method setJGroup
- *
- *
- *
- * @param index
- * @param vJGroup
- */
- public void setJGroup(int index, jalview.binding.JGroup vJGroup)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _JGroupList.size())) {
- throw new IndexOutOfBoundsException();
- }
- _JGroupList.setElementAt(vJGroup, index);
- } //-- void setJGroup(int, jalview.binding.JGroup)
-
- /**
- * Method setJGroup
- *
- *
- *
- * @param JGroupArray
- */
- public void setJGroup(jalview.binding.JGroup[] JGroupArray)
- {
- //-- copy array
- _JGroupList.removeAllElements();
- for (int i = 0; i < JGroupArray.length; i++) {
- _JGroupList.addElement(JGroupArray[i]);
- }
- } //-- void setJGroup(jalview.binding.JGroup)
-
- /**
- * Method setJSeq
- *
- *
- *
- * @param index
- * @param vJSeq
- */
- public void setJSeq(int index, jalview.binding.JSeq vJSeq)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _JSeqList.size())) {
- throw new IndexOutOfBoundsException();
- }
- _JSeqList.setElementAt(vJSeq, index);
- } //-- void setJSeq(int, jalview.binding.JSeq)
-
- /**
- * Method setJSeq
- *
- *
- *
- * @param JSeqArray
- */
- public void setJSeq(jalview.binding.JSeq[] JSeqArray)
- {
- //-- copy array
- _JSeqList.removeAllElements();
- for (int i = 0; i < JSeqArray.length; i++) {
- _JSeqList.addElement(JSeqArray[i]);
- }
- } //-- void setJSeq(jalview.binding.JSeq)
-
- /**
- * Method setUserColours
- *
- *
- *
- * @param index
- * @param vUserColours
- */
- public void setUserColours(int index, jalview.binding.UserColours vUserColours)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _userColoursList.size())) {
- throw new IndexOutOfBoundsException();
- }
- _userColoursList.setElementAt(vUserColours, index);
- } //-- void setUserColours(int, jalview.binding.UserColours)
-
- /**
- * Method setUserColours
- *
- *
- *
- * @param userColoursArray
- */
- public void setUserColours(jalview.binding.UserColours[] userColoursArray)
- {
- //-- copy array
- _userColoursList.removeAllElements();
- for (int i = 0; i < userColoursArray.length; i++) {
- _userColoursList.addElement(userColoursArray[i]);
- }
- } //-- void setUserColours(jalview.binding.UserColours)
-
- /**
- * Method setViewport
- *
- *
- *
- * @param index
- * @param vViewport
- */
- public void setViewport(int index, jalview.binding.Viewport vViewport)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _viewportList.size())) {
- throw new IndexOutOfBoundsException();
- }
- _viewportList.setElementAt(vViewport, index);
- } //-- void setViewport(int, jalview.binding.Viewport)
-
- /**
- * Method setViewport
- *
- *
- *
- * @param viewportArray
- */
- public void setViewport(jalview.binding.Viewport[] viewportArray)
- {
- //-- copy array
- _viewportList.removeAllElements();
- for (int i = 0; i < viewportArray.length; i++) {
- _viewportList.addElement(viewportArray[i]);
- }
- } //-- void setViewport(jalview.binding.Viewport)
-
- /**
- * Method unmarshal
- *
- *
- *
- * @param reader
- * @return Object
- */
- public static java.lang.Object unmarshal(java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
- {
- return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);
- } //-- java.lang.Object unmarshal(java.io.Reader)
-
- /**
- * Method validate
- *
- */
- 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()
-
-}
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
+ * Copyright (C) 2014 The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see
+ * 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 + * know that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public jalview.binding.JGroup[] getJGroup() + { + jalview.binding.JGroup[] array = new jalview.binding.JGroup[0]; + return (jalview.binding.JGroup[]) this._JGroupList.toArray(array); + } + + /** + * Method getJGroupCount. + * + * @return the size of this collection + */ + public int getJGroupCount() + { + return this._JGroupList.size(); + } + + /** + * Method getJSeq. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.JSeq at the given index + */ + public jalview.binding.JSeq getJSeq(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JSeqList.size()) + { + throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); + } + + return (jalview.binding.JSeq) _JSeqList.get(index); + } + + /** + * Method getJSeq.Returns the contents of the collection in an Array. + *
+ * 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 + * know that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public jalview.binding.JSeq[] getJSeq() + { + jalview.binding.JSeq[] array = new jalview.binding.JSeq[0]; + return (jalview.binding.JSeq[]) this._JSeqList.toArray(array); + } + + /** + * Method getJSeqCount. + * + * @return the size of this collection + */ + public int getJSeqCount() + { + return this._JSeqList.size(); + } + + /** + * Method getTree. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Tree at the given index + */ + public jalview.binding.Tree getTree(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("getTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); + } + + return (jalview.binding.Tree) _treeList.get(index); + } + + /** + * Method getTree.Returns the contents of the collection in an Array. + *
+ * 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 + * know that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public jalview.binding.Tree[] getTree() + { + jalview.binding.Tree[] array = new jalview.binding.Tree[0]; + return (jalview.binding.Tree[]) this._treeList.toArray(array); + } + + /** + * Method getTreeCount. + * + * @return the size of this collection + */ + public int getTreeCount() + { + return this._treeList.size(); + } + + /** + * Method getUserColours. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.UserColours at the given index + */ + public jalview.binding.UserColours getUserColours(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._userColoursList.size()) + { + throw new IndexOutOfBoundsException("getUserColours: Index value '" + + index + "' not in range [0.." + + (this._userColoursList.size() - 1) + "]"); + } + + return (jalview.binding.UserColours) _userColoursList.get(index); + } + + /** + * Method getUserColours.Returns the contents of the collection in an Array. + *
+ * 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 + * know that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public jalview.binding.UserColours[] getUserColours() + { + jalview.binding.UserColours[] array = new jalview.binding.UserColours[0]; + return (jalview.binding.UserColours[]) this._userColoursList + .toArray(array); + } + + /** + * Method getUserColoursCount. + * + * @return the size of this collection + */ + public int getUserColoursCount() + { + return this._userColoursList.size(); + } + + /** + * Method getViewport. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Viewport at the given index + */ + public jalview.binding.Viewport getViewport(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._viewportList.size()) + { + throw new IndexOutOfBoundsException("getViewport: Index value '" + + index + "' not in range [0.." + + (this._viewportList.size() - 1) + "]"); + } + + return (jalview.binding.Viewport) _viewportList.get(index); + } + + /** + * Method getViewport.Returns the contents of the collection in an Array. + *
+ * 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 + * know that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public jalview.binding.Viewport[] getViewport() + { + jalview.binding.Viewport[] array = new jalview.binding.Viewport[0]; + return (jalview.binding.Viewport[]) this._viewportList.toArray(array); + } + + /** + * Method getViewportCount. + * + * @return the size of this collection + */ + public int getViewportCount() + { + return this._viewportList.size(); + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; + } + return true; + } + + /** + * + * + * @param out + * @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); + } + + /** + * + * + * @param handler + * @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); + } + + /** + */ + public void removeAllJGroup() + { + this._JGroupList.clear(); + } + + /** + */ + public void removeAllJSeq() + { + this._JSeqList.clear(); + } + + /** + */ + public void removeAllTree() + { + this._treeList.clear(); + } + + /** + */ + public void removeAllUserColours() + { + this._userColoursList.clear(); + } + + /** + */ + public void removeAllViewport() + { + this._viewportList.clear(); + } + + /** + * Method removeJGroup. + * + * @param vJGroup + * @return true if the object was removed from the collection. + */ + public boolean removeJGroup(final jalview.binding.JGroup vJGroup) + { + boolean removed = _JGroupList.remove(vJGroup); + return removed; + } + + /** + * Method removeJGroupAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.JGroup removeJGroupAt(final int index) + { + java.lang.Object obj = this._JGroupList.remove(index); + return (jalview.binding.JGroup) obj; + } + + /** + * Method removeJSeq. + * + * @param vJSeq + * @return true if the object was removed from the collection. + */ + public boolean removeJSeq(final jalview.binding.JSeq vJSeq) + { + boolean removed = _JSeqList.remove(vJSeq); + return removed; + } + + /** + * Method removeJSeqAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.JSeq removeJSeqAt(final int index) + { + java.lang.Object obj = this._JSeqList.remove(index); + return (jalview.binding.JSeq) obj; + } + + /** + * Method removeTree. + * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree(final jalview.binding.Tree vTree) + { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Tree removeTreeAt(final int index) + { + java.lang.Object obj = this._treeList.remove(index); + return (jalview.binding.Tree) obj; + } + + /** + * Method removeUserColours. + * + * @param vUserColours + * @return true if the object was removed from the collection. + */ + public boolean removeUserColours( + final jalview.binding.UserColours vUserColours) + { + boolean removed = _userColoursList.remove(vUserColours); + return removed; + } + + /** + * Method removeUserColoursAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.UserColours removeUserColoursAt(final int index) + { + java.lang.Object obj = this._userColoursList.remove(index); + return (jalview.binding.UserColours) obj; + } + + /** + * Method removeViewport. + * + * @param vViewport + * @return true if the object was removed from the collection. + */ + public boolean removeViewport(final jalview.binding.Viewport vViewport) + { + boolean removed = _viewportList.remove(vViewport); + return removed; + } + + /** + * Method removeViewportAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Viewport removeViewportAt(final int index) + { + java.lang.Object obj = this._viewportList.remove(index); + return (jalview.binding.Viewport) obj; + } + + /** + * Sets the value of field 'featureSettings'. + * + * @param featureSettings + * the value of field 'featureSettings'. + */ + public void setFeatureSettings( + final jalview.binding.FeatureSettings featureSettings) + { + this._featureSettings = featureSettings; + } + + /** + * + * + * @param index + * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setJGroup(final int index, + final jalview.binding.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JGroupList.size()) + { + throw new IndexOutOfBoundsException("setJGroup: Index value '" + + index + "' not in range [0.." + + (this._JGroupList.size() - 1) + "]"); + } + + this._JGroupList.set(index, vJGroup); + } + + /** + * + * + * @param vJGroupArray + */ + public void setJGroup(final jalview.binding.JGroup[] vJGroupArray) + { + // -- copy array + _JGroupList.clear(); + + for (int i = 0; i < vJGroupArray.length; i++) + { + this._JGroupList.add(vJGroupArray[i]); + } + } + + /** + * + * + * @param index + * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setJSeq(final int index, final jalview.binding.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JSeqList.size()) + { + throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); + } + + this._JSeqList.set(index, vJSeq); + } + + /** + * + * + * @param vJSeqArray + */ + public void setJSeq(final jalview.binding.JSeq[] vJSeqArray) + { + // -- copy array + _JSeqList.clear(); + + for (int i = 0; i < vJSeqArray.length; i++) + { + this._JSeqList.add(vJSeqArray[i]); + } + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setTree(final int index, final jalview.binding.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); + } + + this._treeList.set(index, vTree); + } + + /** + * + * + * @param vTreeArray + */ + public void setTree(final jalview.binding.Tree[] vTreeArray) + { + // -- copy array + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) + { + this._treeList.add(vTreeArray[i]); + } + } + + /** + * + * + * @param index + * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setUserColours(final int index, + final jalview.binding.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._userColoursList.size()) + { + throw new IndexOutOfBoundsException("setUserColours: Index value '" + + index + "' not in range [0.." + + (this._userColoursList.size() - 1) + "]"); + } + + this._userColoursList.set(index, vUserColours); + } + + /** + * + * + * @param vUserColoursArray + */ + public void setUserColours( + final jalview.binding.UserColours[] vUserColoursArray) + { + // -- copy array + _userColoursList.clear(); + + for (int i = 0; i < vUserColoursArray.length; i++) + { + this._userColoursList.add(vUserColoursArray[i]); + } + } + + /** + * + * + * @param index + * @param vViewport + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setViewport(final int index, + final jalview.binding.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._viewportList.size()) + { + throw new IndexOutOfBoundsException("setViewport: Index value '" + + index + "' not in range [0.." + + (this._viewportList.size() - 1) + "]"); + } + + this._viewportList.set(index, vViewport); + } + + /** + * + * + * @param vViewportArray + */ + public void setViewport(final jalview.binding.Viewport[] vViewportArray) + { + // -- copy array + _viewportList.clear(); + + for (int i = 0; i < vViewportArray.length; i++) + { + this._viewportList.add(vViewportArray[i]); + } + } + + /** + * Method unmarshal. + * + * @param reader + * @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 jalview.binding.JalviewModelSequence + */ + public static jalview.binding.JalviewModelSequence unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal( + jalview.binding.JalviewModelSequence.class, reader); + } + + /** + * + * + * @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 + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } + +}