-/*\r
- * This class was automatically generated with\r
- * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
- * Schema.\r
- * $Id$\r
- */\r
-\r
-package jalview.binding;\r
-\r
-//---------------------------------/\r
-//- Imported classes and packages -/\r
-//---------------------------------/\r
-\r
-import java.util.*;\r
-\r
-import org.exolab.castor.xml.*;\r
-\r
-/**\r
- * Class JalviewModelSequence.\r
- *\r
- * @version $Revision$ $Date$\r
- */\r
-public class JalviewModelSequence\r
- implements java.io.Serializable\r
-{\r
-\r
- //--------------------------/\r
- //- Class/Member Variables -/\r
- //--------------------------/\r
-\r
- /**\r
- * Field _JSeqList\r
- */\r
- private java.util.Vector _JSeqList;\r
-\r
- /**\r
- * Field _JGroupList\r
- */\r
- private java.util.Vector _JGroupList;\r
-\r
- /**\r
- * Field _viewportList\r
- */\r
- private java.util.Vector _viewportList;\r
-\r
- /**\r
- * Field _userColoursList\r
- */\r
- private java.util.Vector _userColoursList;\r
-\r
- /**\r
- * Field _treeList\r
- */\r
- private java.util.Vector _treeList;\r
-\r
- //----------------/\r
- //- Constructors -/\r
- //----------------/\r
-\r
- public JalviewModelSequence()\r
- {\r
- super();\r
- _JSeqList = new Vector();\r
- _JGroupList = new Vector();\r
- _viewportList = new Vector();\r
- _userColoursList = new Vector();\r
- _treeList = new Vector();\r
- } //-- jalview.binding.JalviewModelSequence()\r
-\r
- //-----------/\r
- //- Methods -/\r
- //-----------/\r
-\r
- /**\r
- * Method addJGroup\r
- *\r
- *\r
- *\r
- * @param vJGroup\r
- */\r
- public void addJGroup(jalview.binding.JGroup vJGroup)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _JGroupList.addElement(vJGroup);\r
- } //-- void addJGroup(jalview.binding.JGroup)\r
-\r
- /**\r
- * Method addJGroup\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vJGroup\r
- */\r
- public void addJGroup(int index, jalview.binding.JGroup vJGroup)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _JGroupList.insertElementAt(vJGroup, index);\r
- } //-- void addJGroup(int, jalview.binding.JGroup)\r
-\r
- /**\r
- * Method addJSeq\r
- *\r
- *\r
- *\r
- * @param vJSeq\r
- */\r
- public void addJSeq(jalview.binding.JSeq vJSeq)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _JSeqList.addElement(vJSeq);\r
- } //-- void addJSeq(jalview.binding.JSeq)\r
-\r
- /**\r
- * Method addJSeq\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vJSeq\r
- */\r
- public void addJSeq(int index, jalview.binding.JSeq vJSeq)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _JSeqList.insertElementAt(vJSeq, index);\r
- } //-- void addJSeq(int, jalview.binding.JSeq)\r
-\r
- /**\r
- * Method addTree\r
- *\r
- *\r
- *\r
- * @param vTree\r
- */\r
- public void addTree(jalview.binding.Tree vTree)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _treeList.addElement(vTree);\r
- } //-- void addTree(jalview.binding.Tree)\r
-\r
- /**\r
- * Method addTree\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vTree\r
- */\r
- public void addTree(int index, jalview.binding.Tree vTree)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _treeList.insertElementAt(vTree, index);\r
- } //-- void addTree(int, jalview.binding.Tree)\r
-\r
- /**\r
- * Method addUserColours\r
- *\r
- *\r
- *\r
- * @param vUserColours\r
- */\r
- public void addUserColours(jalview.binding.UserColours vUserColours)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _userColoursList.addElement(vUserColours);\r
- } //-- void addUserColours(jalview.binding.UserColours)\r
-\r
- /**\r
- * Method addUserColours\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vUserColours\r
- */\r
- public void addUserColours(int index,\r
- jalview.binding.UserColours vUserColours)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _userColoursList.insertElementAt(vUserColours, index);\r
- } //-- void addUserColours(int, jalview.binding.UserColours)\r
-\r
- /**\r
- * Method addViewport\r
- *\r
- *\r
- *\r
- * @param vViewport\r
- */\r
- public void addViewport(jalview.binding.Viewport vViewport)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _viewportList.addElement(vViewport);\r
- } //-- void addViewport(jalview.binding.Viewport)\r
-\r
- /**\r
- * Method addViewport\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vViewport\r
- */\r
- public void addViewport(int index, jalview.binding.Viewport vViewport)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- _viewportList.insertElementAt(vViewport, index);\r
- } //-- void addViewport(int, jalview.binding.Viewport)\r
-\r
- /**\r
- * Method enumerateJGroup\r
- *\r
- *\r
- *\r
- * @return Enumeration\r
- */\r
- public java.util.Enumeration enumerateJGroup()\r
- {\r
- return _JGroupList.elements();\r
- } //-- java.util.Enumeration enumerateJGroup()\r
-\r
- /**\r
- * Method enumerateJSeq\r
- *\r
- *\r
- *\r
- * @return Enumeration\r
- */\r
- public java.util.Enumeration enumerateJSeq()\r
- {\r
- return _JSeqList.elements();\r
- } //-- java.util.Enumeration enumerateJSeq()\r
-\r
- /**\r
- * Method enumerateTree\r
- *\r
- *\r
- *\r
- * @return Enumeration\r
- */\r
- public java.util.Enumeration enumerateTree()\r
- {\r
- return _treeList.elements();\r
- } //-- java.util.Enumeration enumerateTree()\r
-\r
- /**\r
- * Method enumerateUserColours\r
- *\r
- *\r
- *\r
- * @return Enumeration\r
- */\r
- public java.util.Enumeration enumerateUserColours()\r
- {\r
- return _userColoursList.elements();\r
- } //-- java.util.Enumeration enumerateUserColours()\r
-\r
- /**\r
- * Method enumerateViewport\r
- *\r
- *\r
- *\r
- * @return Enumeration\r
- */\r
- public java.util.Enumeration enumerateViewport()\r
- {\r
- return _viewportList.elements();\r
- } //-- java.util.Enumeration enumerateViewport()\r
-\r
- /**\r
- * Method getJGroup\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return JGroup\r
- */\r
- public jalview.binding.JGroup getJGroup(int index)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _JGroupList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
-\r
- return (jalview.binding.JGroup) _JGroupList.elementAt(index);\r
- } //-- jalview.binding.JGroup getJGroup(int)\r
-\r
- /**\r
- * Method getJGroup\r
- *\r
- *\r
- *\r
- * @return JGroup\r
- */\r
- public jalview.binding.JGroup[] getJGroup()\r
- {\r
- int size = _JGroupList.size();\r
- jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];\r
- for (int index = 0; index < size; index++)\r
- {\r
- mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);\r
- }\r
- return mArray;\r
- } //-- jalview.binding.JGroup[] getJGroup()\r
-\r
- /**\r
- * Method getJGroupCount\r
- *\r
- *\r
- *\r
- * @return int\r
- */\r
- public int getJGroupCount()\r
- {\r
- return _JGroupList.size();\r
- } //-- int getJGroupCount()\r
-\r
- /**\r
- * Method getJSeq\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return JSeq\r
- */\r
- public jalview.binding.JSeq getJSeq(int index)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _JSeqList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
-\r
- return (jalview.binding.JSeq) _JSeqList.elementAt(index);\r
- } //-- jalview.binding.JSeq getJSeq(int)\r
-\r
- /**\r
- * Method getJSeq\r
- *\r
- *\r
- *\r
- * @return JSeq\r
- */\r
- public jalview.binding.JSeq[] getJSeq()\r
- {\r
- int size = _JSeqList.size();\r
- jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];\r
- for (int index = 0; index < size; index++)\r
- {\r
- mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);\r
- }\r
- return mArray;\r
- } //-- jalview.binding.JSeq[] getJSeq()\r
-\r
- /**\r
- * Method getJSeqCount\r
- *\r
- *\r
- *\r
- * @return int\r
- */\r
- public int getJSeqCount()\r
- {\r
- return _JSeqList.size();\r
- } //-- int getJSeqCount()\r
-\r
- /**\r
- * Method getTree\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return Tree\r
- */\r
- public jalview.binding.Tree getTree(int index)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _treeList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
-\r
- return (jalview.binding.Tree) _treeList.elementAt(index);\r
- } //-- jalview.binding.Tree getTree(int)\r
-\r
- /**\r
- * Method getTree\r
- *\r
- *\r
- *\r
- * @return Tree\r
- */\r
- public jalview.binding.Tree[] getTree()\r
- {\r
- int size = _treeList.size();\r
- jalview.binding.Tree[] mArray = new jalview.binding.Tree[size];\r
- for (int index = 0; index < size; index++)\r
- {\r
- mArray[index] = (jalview.binding.Tree) _treeList.elementAt(index);\r
- }\r
- return mArray;\r
- } //-- jalview.binding.Tree[] getTree()\r
-\r
- /**\r
- * Method getTreeCount\r
- *\r
- *\r
- *\r
- * @return int\r
- */\r
- public int getTreeCount()\r
- {\r
- return _treeList.size();\r
- } //-- int getTreeCount()\r
-\r
- /**\r
- * Method getUserColours\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return UserColours\r
- */\r
- public jalview.binding.UserColours getUserColours(int index)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _userColoursList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
-\r
- return (jalview.binding.UserColours) _userColoursList.elementAt(index);\r
- } //-- jalview.binding.UserColours getUserColours(int)\r
-\r
- /**\r
- * Method getUserColours\r
- *\r
- *\r
- *\r
- * @return UserColours\r
- */\r
- public jalview.binding.UserColours[] getUserColours()\r
- {\r
- int size = _userColoursList.size();\r
- jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size];\r
- for (int index = 0; index < size; index++)\r
- {\r
- mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(\r
- index);\r
- }\r
- return mArray;\r
- } //-- jalview.binding.UserColours[] getUserColours()\r
-\r
- /**\r
- * Method getUserColoursCount\r
- *\r
- *\r
- *\r
- * @return int\r
- */\r
- public int getUserColoursCount()\r
- {\r
- return _userColoursList.size();\r
- } //-- int getUserColoursCount()\r
-\r
- /**\r
- * Method getViewport\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return Viewport\r
- */\r
- public jalview.binding.Viewport getViewport(int index)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _viewportList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
-\r
- return (jalview.binding.Viewport) _viewportList.elementAt(index);\r
- } //-- jalview.binding.Viewport getViewport(int)\r
-\r
- /**\r
- * Method getViewport\r
- *\r
- *\r
- *\r
- * @return Viewport\r
- */\r
- public jalview.binding.Viewport[] getViewport()\r
- {\r
- int size = _viewportList.size();\r
- jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];\r
- for (int index = 0; index < size; index++)\r
- {\r
- mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);\r
- }\r
- return mArray;\r
- } //-- jalview.binding.Viewport[] getViewport()\r
-\r
- /**\r
- * Method getViewportCount\r
- *\r
- *\r
- *\r
- * @return int\r
- */\r
- public int getViewportCount()\r
- {\r
- return _viewportList.size();\r
- } //-- int getViewportCount()\r
-\r
- /**\r
- * Method isValid\r
- *\r
- *\r
- *\r
- * @return boolean\r
- */\r
- public boolean isValid()\r
- {\r
- try\r
- {\r
- validate();\r
- }\r
- catch (org.exolab.castor.xml.ValidationException vex)\r
- {\r
- return false;\r
- }\r
- return true;\r
- } //-- boolean isValid()\r
-\r
- /**\r
- * Method marshal\r
- *\r
- *\r
- *\r
- * @param out\r
- */\r
- public void marshal(java.io.Writer out)\r
- throws org.exolab.castor.xml.MarshalException,\r
- org.exolab.castor.xml.ValidationException\r
- {\r
-\r
- Marshaller.marshal(this, out);\r
- } //-- void marshal(java.io.Writer)\r
-\r
- /**\r
- * Method marshal\r
- *\r
- *\r
- *\r
- * @param handler\r
- */\r
- public void marshal(org.xml.sax.ContentHandler handler)\r
- throws java.io.IOException, org.exolab.castor.xml.MarshalException,\r
- org.exolab.castor.xml.ValidationException\r
- {\r
-\r
- Marshaller.marshal(this, handler);\r
- } //-- void marshal(org.xml.sax.ContentHandler)\r
-\r
- /**\r
- * Method removeAllJGroup\r
- *\r
- */\r
- public void removeAllJGroup()\r
- {\r
- _JGroupList.removeAllElements();\r
- } //-- void removeAllJGroup()\r
-\r
- /**\r
- * Method removeAllJSeq\r
- *\r
- */\r
- public void removeAllJSeq()\r
- {\r
- _JSeqList.removeAllElements();\r
- } //-- void removeAllJSeq()\r
-\r
- /**\r
- * Method removeAllTree\r
- *\r
- */\r
- public void removeAllTree()\r
- {\r
- _treeList.removeAllElements();\r
- } //-- void removeAllTree()\r
-\r
- /**\r
- * Method removeAllUserColours\r
- *\r
- */\r
- public void removeAllUserColours()\r
- {\r
- _userColoursList.removeAllElements();\r
- } //-- void removeAllUserColours()\r
-\r
- /**\r
- * Method removeAllViewport\r
- *\r
- */\r
- public void removeAllViewport()\r
- {\r
- _viewportList.removeAllElements();\r
- } //-- void removeAllViewport()\r
-\r
- /**\r
- * Method removeJGroup\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return JGroup\r
- */\r
- public jalview.binding.JGroup removeJGroup(int index)\r
- {\r
- java.lang.Object obj = _JGroupList.elementAt(index);\r
- _JGroupList.removeElementAt(index);\r
- return (jalview.binding.JGroup) obj;\r
- } //-- jalview.binding.JGroup removeJGroup(int)\r
-\r
- /**\r
- * Method removeJSeq\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return JSeq\r
- */\r
- public jalview.binding.JSeq removeJSeq(int index)\r
- {\r
- java.lang.Object obj = _JSeqList.elementAt(index);\r
- _JSeqList.removeElementAt(index);\r
- return (jalview.binding.JSeq) obj;\r
- } //-- jalview.binding.JSeq removeJSeq(int)\r
-\r
- /**\r
- * Method removeTree\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return Tree\r
- */\r
- public jalview.binding.Tree removeTree(int index)\r
- {\r
- java.lang.Object obj = _treeList.elementAt(index);\r
- _treeList.removeElementAt(index);\r
- return (jalview.binding.Tree) obj;\r
- } //-- jalview.binding.Tree removeTree(int)\r
-\r
- /**\r
- * Method removeUserColours\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return UserColours\r
- */\r
- public jalview.binding.UserColours removeUserColours(int index)\r
- {\r
- java.lang.Object obj = _userColoursList.elementAt(index);\r
- _userColoursList.removeElementAt(index);\r
- return (jalview.binding.UserColours) obj;\r
- } //-- jalview.binding.UserColours removeUserColours(int)\r
-\r
- /**\r
- * Method removeViewport\r
- *\r
- *\r
- *\r
- * @param index\r
- * @return Viewport\r
- */\r
- public jalview.binding.Viewport removeViewport(int index)\r
- {\r
- java.lang.Object obj = _viewportList.elementAt(index);\r
- _viewportList.removeElementAt(index);\r
- return (jalview.binding.Viewport) obj;\r
- } //-- jalview.binding.Viewport removeViewport(int)\r
-\r
- /**\r
- * Method setJGroup\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vJGroup\r
- */\r
- public void setJGroup(int index, jalview.binding.JGroup vJGroup)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _JGroupList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
- _JGroupList.setElementAt(vJGroup, index);\r
- } //-- void setJGroup(int, jalview.binding.JGroup)\r
-\r
- /**\r
- * Method setJGroup\r
- *\r
- *\r
- *\r
- * @param JGroupArray\r
- */\r
- public void setJGroup(jalview.binding.JGroup[] JGroupArray)\r
- {\r
- //-- copy array\r
- _JGroupList.removeAllElements();\r
- for (int i = 0; i < JGroupArray.length; i++)\r
- {\r
- _JGroupList.addElement(JGroupArray[i]);\r
- }\r
- } //-- void setJGroup(jalview.binding.JGroup)\r
-\r
- /**\r
- * Method setJSeq\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vJSeq\r
- */\r
- public void setJSeq(int index, jalview.binding.JSeq vJSeq)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _JSeqList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
- _JSeqList.setElementAt(vJSeq, index);\r
- } //-- void setJSeq(int, jalview.binding.JSeq)\r
-\r
- /**\r
- * Method setJSeq\r
- *\r
- *\r
- *\r
- * @param JSeqArray\r
- */\r
- public void setJSeq(jalview.binding.JSeq[] JSeqArray)\r
- {\r
- //-- copy array\r
- _JSeqList.removeAllElements();\r
- for (int i = 0; i < JSeqArray.length; i++)\r
- {\r
- _JSeqList.addElement(JSeqArray[i]);\r
- }\r
- } //-- void setJSeq(jalview.binding.JSeq)\r
-\r
- /**\r
- * Method setTree\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vTree\r
- */\r
- public void setTree(int index, jalview.binding.Tree vTree)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _treeList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
- _treeList.setElementAt(vTree, index);\r
- } //-- void setTree(int, jalview.binding.Tree)\r
-\r
- /**\r
- * Method setTree\r
- *\r
- *\r
- *\r
- * @param treeArray\r
- */\r
- public void setTree(jalview.binding.Tree[] treeArray)\r
- {\r
- //-- copy array\r
- _treeList.removeAllElements();\r
- for (int i = 0; i < treeArray.length; i++)\r
- {\r
- _treeList.addElement(treeArray[i]);\r
- }\r
- } //-- void setTree(jalview.binding.Tree)\r
-\r
- /**\r
- * Method setUserColours\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vUserColours\r
- */\r
- public void setUserColours(int index,\r
- jalview.binding.UserColours vUserColours)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _userColoursList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
- _userColoursList.setElementAt(vUserColours, index);\r
- } //-- void setUserColours(int, jalview.binding.UserColours)\r
-\r
- /**\r
- * Method setUserColours\r
- *\r
- *\r
- *\r
- * @param userColoursArray\r
- */\r
- public void setUserColours(jalview.binding.UserColours[] userColoursArray)\r
- {\r
- //-- copy array\r
- _userColoursList.removeAllElements();\r
- for (int i = 0; i < userColoursArray.length; i++)\r
- {\r
- _userColoursList.addElement(userColoursArray[i]);\r
- }\r
- } //-- void setUserColours(jalview.binding.UserColours)\r
-\r
- /**\r
- * Method setViewport\r
- *\r
- *\r
- *\r
- * @param index\r
- * @param vViewport\r
- */\r
- public void setViewport(int index, jalview.binding.Viewport vViewport)\r
- throws java.lang.IndexOutOfBoundsException\r
- {\r
- //-- check bounds for index\r
- if ( (index < 0) || (index > _viewportList.size()))\r
- {\r
- throw new IndexOutOfBoundsException();\r
- }\r
- _viewportList.setElementAt(vViewport, index);\r
- } //-- void setViewport(int, jalview.binding.Viewport)\r
-\r
- /**\r
- * Method setViewport\r
- *\r
- *\r
- *\r
- * @param viewportArray\r
- */\r
- public void setViewport(jalview.binding.Viewport[] viewportArray)\r
- {\r
- //-- copy array\r
- _viewportList.removeAllElements();\r
- for (int i = 0; i < viewportArray.length; i++)\r
- {\r
- _viewportList.addElement(viewportArray[i]);\r
- }\r
- } //-- void setViewport(jalview.binding.Viewport)\r
-\r
- /**\r
- * Method unmarshal\r
- *\r
- *\r
- *\r
- * @param reader\r
- * @return Object\r
- */\r
- public static java.lang.Object unmarshal(java.io.Reader reader)\r
- throws org.exolab.castor.xml.MarshalException,\r
- org.exolab.castor.xml.ValidationException\r
- {\r
- return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(\r
- jalview.binding.JalviewModelSequence.class, reader);\r
- } //-- java.lang.Object unmarshal(java.io.Reader)\r
-\r
- /**\r
- * Method validate\r
- *\r
- */\r
- public void validate()\r
- throws org.exolab.castor.xml.ValidationException\r
- {\r
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.\r
- Validator();\r
- validator.validate(this);\r
- } //-- void validate()\r
-\r
-}\r
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ 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 <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.binding;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.util.MessageManager;
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * 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;
+
+ /**
+ * Field _treeList.
+ */
+ private java.util.Vector _treeList;
+
+ /**
+ * Field _featureSettings.
+ */
+ private jalview.binding.FeatureSettings _featureSettings;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public JalviewModelSequence()
+ {
+ super();
+ this._JSeqList = new java.util.Vector();
+ this._JGroupList = new java.util.Vector();
+ this._viewportList = new java.util.Vector();
+ this._userColoursList = new java.util.Vector();
+ this._treeList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vJGroup
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addJGroup(final jalview.binding.JGroup vJGroup)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._JGroupList.addElement(vJGroup);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vJGroup
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addJGroup(final int index,
+ final jalview.binding.JGroup vJGroup)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._JGroupList.add(index, vJGroup);
+ }
+
+ /**
+ *
+ *
+ * @param vJSeq
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addJSeq(final jalview.binding.JSeq vJSeq)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._JSeqList.addElement(vJSeq);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vJSeq
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addJSeq(final int index, final jalview.binding.JSeq vJSeq)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._JSeqList.add(index, vJSeq);
+ }
+
+ /**
+ *
+ *
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTree(final jalview.binding.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._treeList.addElement(vTree);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTree(final int index, final jalview.binding.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._treeList.add(index, vTree);
+ }
+
+ /**
+ *
+ *
+ * @param vUserColours
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addUserColours(final jalview.binding.UserColours vUserColours)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._userColoursList.addElement(vUserColours);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vUserColours
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addUserColours(final int index,
+ final jalview.binding.UserColours vUserColours)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._userColoursList.add(index, vUserColours);
+ }
+
+ /**
+ *
+ *
+ * @param vViewport
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addViewport(final jalview.binding.Viewport vViewport)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._viewportList.addElement(vViewport);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vViewport
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addViewport(final int index,
+ final jalview.binding.Viewport vViewport)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._viewportList.add(index, vViewport);
+ }
+
+ /**
+ * Method enumerateJGroup.
+ *
+ * @return an Enumeration over all jalview.binding.JGroup elements
+ */
+ public java.util.Enumeration enumerateJGroup()
+ {
+ return this._JGroupList.elements();
+ }
+
+ /**
+ * Method enumerateJSeq.
+ *
+ * @return an Enumeration over all jalview.binding.JSeq elements
+ */
+ public java.util.Enumeration enumerateJSeq()
+ {
+ return this._JSeqList.elements();
+ }
+
+ /**
+ * Method enumerateTree.
+ *
+ * @return an Enumeration over all jalview.binding.Tree elements
+ */
+ public java.util.Enumeration enumerateTree()
+ {
+ return this._treeList.elements();
+ }
+
+ /**
+ * Method enumerateUserColours.
+ *
+ * @return an Enumeration over all jalview.binding.UserColours elements
+ */
+ public java.util.Enumeration enumerateUserColours()
+ {
+ return this._userColoursList.elements();
+ }
+
+ /**
+ * Method enumerateViewport.
+ *
+ * @return an Enumeration over all jalview.binding.Viewport elements
+ */
+ public java.util.Enumeration enumerateViewport()
+ {
+ return this._viewportList.elements();
+ }
+
+ /**
+ * Returns the value of field 'featureSettings'.
+ *
+ * @return the value of field 'FeatureSettings'.
+ */
+ public jalview.binding.FeatureSettings getFeatureSettings()
+ {
+ return this._featureSettings;
+ }
+
+ /**
+ * Method getJGroup.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the jalview.binding.JGroup at the given index
+ */
+ public jalview.binding.JGroup getJGroup(final int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._JGroupList.size())
+ {
+ throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "getJGroup",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._JGroupList.size() - 1)).toString()
+ }));
+ }
+
+ return (jalview.binding.JGroup) _JGroupList.get(index);
+ }
+
+ /**
+ * Method getJGroup.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 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "getJSeq",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._JSeqList.size() - 1)).toString()
+ }));
+ }
+
+ return (jalview.binding.JSeq) _JSeqList.get(index);
+ }
+
+ /**
+ * Method getJSeq.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 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "getJgetTreeSeq",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._treeList.size() - 1)).toString()
+ }));
+ }
+
+ return (jalview.binding.Tree) _treeList.get(index);
+ }
+
+ /**
+ * Method getTree.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 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "getUserColours",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._userColoursList.size() - 1)).toString()
+ }));
+ }
+
+ return (jalview.binding.UserColours) _userColoursList.get(index);
+ }
+
+ /**
+ * Method getUserColours.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 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "getViewport",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._viewportList.size() - 1)).toString()
+ }));
+ }
+
+ return (jalview.binding.Viewport) _viewportList.get(index);
+ }
+
+ /**
+ * Method getViewport.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 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "setJGroup",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._JGroupList.size() - 1)).toString()
+ }));
+ }
+
+ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "setJSeq",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._JSeqList.size() - 1)).toString()
+ }));
+ }
+
+ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "setTree",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._treeList.size() - 1)).toString()
+ }));
+ }
+
+ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "setUserColours",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._userColoursList.size() - 1)).toString()
+ }));
+ }
+
+ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+ "setViewport",
+ Integer.valueOf(index).toString(),
+ Integer.valueOf((this._viewportList.size() - 1)).toString()
+ }));
+ }
+
+ 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);
+ }
+
+}