X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2FJalviewModelSequence.java;h=3ef30ad8e229a476a828c6595df02729dc181014;hb=65540422b57569f5bb9766742eccacc75f1368f0;hp=45f486b0da3e1755e55c9dcaf1db544d310ae7f8;hpb=65df62f4b048a1615d32ea2c3576082ad2b63af8;p=jalview.git diff --git a/src/jalview/schemabinding/version2/JalviewModelSequence.java b/src/jalview/schemabinding/version2/JalviewModelSequence.java index 45f486b..3ef30ad 100755 --- a/src/jalview/schemabinding/version2/JalviewModelSequence.java +++ b/src/jalview/schemabinding/version2/JalviewModelSequence.java @@ -1,27 +1,29 @@ /* - * This class was automatically generated with - * Castor 0.9.6, using an XML - * Schema. - * $Id$ + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4.1) + * Copyright (C) 2009 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.schemabinding.version2; //---------------------------------/ //- 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. @@ -36,32 +38,32 @@ public class JalviewModelSequence implements java.io.Serializable { //--------------------------/ /** - * Field _JSeqList + * Field _JSeqList. */ private java.util.Vector _JSeqList; /** - * Field _JGroupList + * Field _JGroupList. */ private java.util.Vector _JGroupList; /** - * Field _viewportList + * Field _viewportList. */ private java.util.Vector _viewportList; /** - * Field _userColoursList + * Field _userColoursList. */ private java.util.Vector _userColoursList; /** - * Field _treeList + * Field _treeList. */ private java.util.Vector _treeList; /** - * Field _featureSettings + * Field _featureSettings. */ private jalview.schemabinding.version2.FeatureSettings _featureSettings; @@ -72,12 +74,12 @@ public class JalviewModelSequence implements java.io.Serializable { public JalviewModelSequence() { super(); - _JSeqList = new Vector(); - _JGroupList = new Vector(); - _viewportList = new Vector(); - _userColoursList = new Vector(); - _treeList = new Vector(); - } //-- jalview.schemabinding.version2.JalviewModelSequence() + 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(); + } //-----------/ @@ -85,820 +87,850 @@ public class JalviewModelSequence implements java.io.Serializable { //-----------/ /** - * Method addJGroup - * * * * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addJGroup(jalview.schemabinding.version2.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException - { - _JGroupList.addElement(vJGroup); - } //-- void addJGroup(jalview.schemabinding.version2.JGroup) + public void addJGroup( + final jalview.schemabinding.version2.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException { + this._JGroupList.addElement(vJGroup); + } /** - * Method addJGroup - * * * * @param index * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addJGroup(int index, jalview.schemabinding.version2.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException - { - _JGroupList.insertElementAt(vJGroup, index); - } //-- void addJGroup(int, jalview.schemabinding.version2.JGroup) + public void addJGroup( + final int index, + final jalview.schemabinding.version2.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException { + this._JGroupList.add(index, vJGroup); + } /** - * Method addJSeq - * * * * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addJSeq(jalview.schemabinding.version2.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException - { - _JSeqList.addElement(vJSeq); - } //-- void addJSeq(jalview.schemabinding.version2.JSeq) + public void addJSeq( + final jalview.schemabinding.version2.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException { + this._JSeqList.addElement(vJSeq); + } /** - * Method addJSeq - * * * * @param index * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addJSeq(int index, jalview.schemabinding.version2.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException - { - _JSeqList.insertElementAt(vJSeq, index); - } //-- void addJSeq(int, jalview.schemabinding.version2.JSeq) + public void addJSeq( + final int index, + final jalview.schemabinding.version2.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException { + this._JSeqList.add(index, vJSeq); + } /** - * Method addTree - * * * * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(jalview.schemabinding.version2.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.addElement(vTree); - } //-- void addTree(jalview.schemabinding.version2.Tree) + public void addTree( + final jalview.schemabinding.version2.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.addElement(vTree); + } /** - * Method addTree - * * * * @param index * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(int index, jalview.schemabinding.version2.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.insertElementAt(vTree, index); - } //-- void addTree(int, jalview.schemabinding.version2.Tree) + public void addTree( + final int index, + final jalview.schemabinding.version2.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.add(index, vTree); + } /** - * Method addUserColours - * * * * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addUserColours(jalview.schemabinding.version2.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException - { - _userColoursList.addElement(vUserColours); - } //-- void addUserColours(jalview.schemabinding.version2.UserColours) + public void addUserColours( + final jalview.schemabinding.version2.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException { + this._userColoursList.addElement(vUserColours); + } /** - * Method addUserColours - * * * * @param index * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addUserColours(int index, jalview.schemabinding.version2.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException - { - _userColoursList.insertElementAt(vUserColours, index); - } //-- void addUserColours(int, jalview.schemabinding.version2.UserColours) + public void addUserColours( + final int index, + final jalview.schemabinding.version2.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException { + this._userColoursList.add(index, vUserColours); + } /** - * Method addViewport - * * * * @param vViewport + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addViewport(jalview.schemabinding.version2.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException - { - _viewportList.addElement(vViewport); - } //-- void addViewport(jalview.schemabinding.version2.Viewport) + public void addViewport( + final jalview.schemabinding.version2.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException { + this._viewportList.addElement(vViewport); + } /** - * Method addViewport - * * * * @param index * @param vViewport + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addViewport(int index, jalview.schemabinding.version2.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException - { - _viewportList.insertElementAt(vViewport, index); - } //-- void addViewport(int, jalview.schemabinding.version2.Viewport) + public void addViewport( + final int index, + final jalview.schemabinding.version2.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException { + this._viewportList.add(index, vViewport); + } /** - * Method enumerateJGroup - * - * + * Method enumerateJGroup. * - * @return Enumeration + * @return an Enumeration over all + * jalview.schemabinding.version2.JGroup elements */ - public java.util.Enumeration enumerateJGroup() - { - return _JGroupList.elements(); - } //-- java.util.Enumeration enumerateJGroup() + public java.util.Enumeration enumerateJGroup( + ) { + return this._JGroupList.elements(); + } /** - * Method enumerateJSeq + * Method enumerateJSeq. * - * - * - * @return Enumeration + * @return an Enumeration over all + * jalview.schemabinding.version2.JSeq elements */ - public java.util.Enumeration enumerateJSeq() - { - return _JSeqList.elements(); - } //-- java.util.Enumeration enumerateJSeq() + public java.util.Enumeration enumerateJSeq( + ) { + return this._JSeqList.elements(); + } /** - * Method enumerateTree - * - * + * Method enumerateTree. * - * @return Enumeration + * @return an Enumeration over all + * jalview.schemabinding.version2.Tree elements */ - public java.util.Enumeration enumerateTree() - { - return _treeList.elements(); - } //-- java.util.Enumeration enumerateTree() + public java.util.Enumeration enumerateTree( + ) { + return this._treeList.elements(); + } /** - * Method enumerateUserColours + * Method enumerateUserColours. * - * - * - * @return Enumeration + * @return an Enumeration over all + * jalview.schemabinding.version2.UserColours elements */ - public java.util.Enumeration enumerateUserColours() - { - return _userColoursList.elements(); - } //-- java.util.Enumeration enumerateUserColours() + public java.util.Enumeration enumerateUserColours( + ) { + return this._userColoursList.elements(); + } /** - * Method enumerateViewport - * - * + * Method enumerateViewport. * - * @return Enumeration + * @return an Enumeration over all + * jalview.schemabinding.version2.Viewport elements */ - public java.util.Enumeration enumerateViewport() - { - return _viewportList.elements(); - } //-- java.util.Enumeration enumerateViewport() + public java.util.Enumeration enumerateViewport( + ) { + return this._viewportList.elements(); + } /** * Returns the value of field 'featureSettings'. * - * @return FeatureSettings - * @return the value of field 'featureSettings'. + * @return the value of field 'FeatureSettings'. */ - public jalview.schemabinding.version2.FeatureSettings getFeatureSettings() - { + public jalview.schemabinding.version2.FeatureSettings getFeatureSettings( + ) { return this._featureSettings; - } //-- jalview.schemabinding.version2.FeatureSettings getFeatureSettings() + } /** - * Method getJGroup - * - * + * Method getJGroup. * * @param index - * @return JGroup - */ - public jalview.schemabinding.version2.JGroup getJGroup(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _JGroupList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * jalview.schemabinding.version2.JGroup at the given index + */ + public jalview.schemabinding.version2.JGroup getJGroup( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._JGroupList.size()) { + throw new IndexOutOfBoundsException("getJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]"); } - return (jalview.schemabinding.version2.JGroup) _JGroupList.elementAt(index); - } //-- jalview.schemabinding.version2.JGroup getJGroup(int) + return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index); + } /** - * Method getJGroup - * - * + * Method getJGroup.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 JGroup + * @return this collection as an Array */ - public jalview.schemabinding.version2.JGroup[] getJGroup() - { - int size = _JGroupList.size(); - jalview.schemabinding.version2.JGroup[] mArray = new jalview.schemabinding.version2.JGroup[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (jalview.schemabinding.version2.JGroup) _JGroupList.elementAt(index); - } - return mArray; - } //-- jalview.schemabinding.version2.JGroup[] getJGroup() + public jalview.schemabinding.version2.JGroup[] getJGroup( + ) { + jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0]; + return (jalview.schemabinding.version2.JGroup[]) this._JGroupList.toArray(array); + } /** - * Method getJGroupCount - * + * Method getJGroupCount. * - * - * @return int + * @return the size of this collection */ - public int getJGroupCount() - { - return _JGroupList.size(); - } //-- int getJGroupCount() + public int getJGroupCount( + ) { + return this._JGroupList.size(); + } /** - * Method getJSeq - * - * + * Method getJSeq. * * @param index - * @return JSeq - */ - public jalview.schemabinding.version2.JSeq getJSeq(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _JSeqList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.JSeq + * at the given index + */ + public jalview.schemabinding.version2.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.schemabinding.version2.JSeq) _JSeqList.elementAt(index); - } //-- jalview.schemabinding.version2.JSeq getJSeq(int) + return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index); + } /** - * Method getJSeq - * + * 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 JSeq + * @return this collection as an Array */ - public jalview.schemabinding.version2.JSeq[] getJSeq() - { - int size = _JSeqList.size(); - jalview.schemabinding.version2.JSeq[] mArray = new jalview.schemabinding.version2.JSeq[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (jalview.schemabinding.version2.JSeq) _JSeqList.elementAt(index); - } - return mArray; - } //-- jalview.schemabinding.version2.JSeq[] getJSeq() + public jalview.schemabinding.version2.JSeq[] getJSeq( + ) { + jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0]; + return (jalview.schemabinding.version2.JSeq[]) this._JSeqList.toArray(array); + } /** - * Method getJSeqCount + * Method getJSeqCount. * - * - * - * @return int + * @return the size of this collection */ - public int getJSeqCount() - { - return _JSeqList.size(); - } //-- int getJSeqCount() + public int getJSeqCount( + ) { + return this._JSeqList.size(); + } /** - * Method getTree - * - * + * Method getTree. * * @param index - * @return Tree - */ - public jalview.schemabinding.version2.Tree getTree(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Tree + * at the given index + */ + public jalview.schemabinding.version2.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.schemabinding.version2.Tree) _treeList.elementAt(index); - } //-- jalview.schemabinding.version2.Tree getTree(int) + return (jalview.schemabinding.version2.Tree) _treeList.get(index); + } /** - * Method getTree + * 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 Tree + * @return this collection as an Array */ - public jalview.schemabinding.version2.Tree[] getTree() - { - int size = _treeList.size(); - jalview.schemabinding.version2.Tree[] mArray = new jalview.schemabinding.version2.Tree[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (jalview.schemabinding.version2.Tree) _treeList.elementAt(index); - } - return mArray; - } //-- jalview.schemabinding.version2.Tree[] getTree() + public jalview.schemabinding.version2.Tree[] getTree( + ) { + jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0]; + return (jalview.schemabinding.version2.Tree[]) this._treeList.toArray(array); + } /** - * Method getTreeCount - * + * Method getTreeCount. * - * - * @return int + * @return the size of this collection */ - public int getTreeCount() - { - return _treeList.size(); - } //-- int getTreeCount() + public int getTreeCount( + ) { + return this._treeList.size(); + } /** - * Method getUserColours - * - * + * Method getUserColours. * * @param index - * @return UserColours - */ - public jalview.schemabinding.version2.UserColours getUserColours(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _userColoursList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * jalview.schemabinding.version2.UserColours at the given index + */ + public jalview.schemabinding.version2.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.schemabinding.version2.UserColours) _userColoursList.elementAt(index); - } //-- jalview.schemabinding.version2.UserColours getUserColours(int) + return (jalview.schemabinding.version2.UserColours) _userColoursList.get(index); + } /** - * Method getUserColours - * + * 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 UserColours + * @return this collection as an Array */ - public jalview.schemabinding.version2.UserColours[] getUserColours() - { - int size = _userColoursList.size(); - jalview.schemabinding.version2.UserColours[] mArray = new jalview.schemabinding.version2.UserColours[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (jalview.schemabinding.version2.UserColours) _userColoursList.elementAt(index); - } - return mArray; - } //-- jalview.schemabinding.version2.UserColours[] getUserColours() + public jalview.schemabinding.version2.UserColours[] getUserColours( + ) { + jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0]; + return (jalview.schemabinding.version2.UserColours[]) this._userColoursList.toArray(array); + } /** - * Method getUserColoursCount - * - * + * Method getUserColoursCount. * - * @return int + * @return the size of this collection */ - public int getUserColoursCount() - { - return _userColoursList.size(); - } //-- int getUserColoursCount() + public int getUserColoursCount( + ) { + return this._userColoursList.size(); + } /** - * Method getViewport - * - * + * Method getViewport. * * @param index - * @return Viewport - */ - public jalview.schemabinding.version2.Viewport getViewport(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _viewportList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * jalview.schemabinding.version2.Viewport at the given index + */ + public jalview.schemabinding.version2.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.schemabinding.version2.Viewport) _viewportList.elementAt(index); - } //-- jalview.schemabinding.version2.Viewport getViewport(int) + return (jalview.schemabinding.version2.Viewport) _viewportList.get(index); + } /** - * Method getViewport - * - * + * 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 Viewport + * @return this collection as an Array */ - public jalview.schemabinding.version2.Viewport[] getViewport() - { - int size = _viewportList.size(); - jalview.schemabinding.version2.Viewport[] mArray = new jalview.schemabinding.version2.Viewport[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (jalview.schemabinding.version2.Viewport) _viewportList.elementAt(index); - } - return mArray; - } //-- jalview.schemabinding.version2.Viewport[] getViewport() + public jalview.schemabinding.version2.Viewport[] getViewport( + ) { + jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0]; + return (jalview.schemabinding.version2.Viewport[]) this._viewportList.toArray(array); + } /** - * Method getViewportCount - * + * Method getViewportCount. * - * - * @return int + * @return the size of this collection */ - public int getViewportCount() - { - return _viewportList.size(); - } //-- int getViewportCount() + public int getViewportCount( + ) { + return this._viewportList.size(); + } /** - * Method isValid - * + * Method isValid. * - * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out - */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); - } //-- void marshal(java.io.Writer) + } /** - * Method marshal - * * * * @param handler - */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); - } //-- void marshal(org.xml.sax.ContentHandler) + } /** - * Method removeAllJGroup - * */ - public void removeAllJGroup() - { - _JGroupList.removeAllElements(); - } //-- void removeAllJGroup() + public void removeAllJGroup( + ) { + this._JGroupList.clear(); + } /** - * Method removeAllJSeq - * */ - public void removeAllJSeq() - { - _JSeqList.removeAllElements(); - } //-- void removeAllJSeq() + public void removeAllJSeq( + ) { + this._JSeqList.clear(); + } /** - * Method removeAllTree - * */ - public void removeAllTree() - { - _treeList.removeAllElements(); - } //-- void removeAllTree() + public void removeAllTree( + ) { + this._treeList.clear(); + } /** - * Method removeAllUserColours - * */ - public void removeAllUserColours() - { - _userColoursList.removeAllElements(); - } //-- void removeAllUserColours() + public void removeAllUserColours( + ) { + this._userColoursList.clear(); + } /** - * Method removeAllViewport - * */ - public void removeAllViewport() - { - _viewportList.removeAllElements(); - } //-- void removeAllViewport() + public void removeAllViewport( + ) { + this._viewportList.clear(); + } /** - * Method removeJGroup - * + * Method removeJGroup. * + * @param vJGroup + * @return true if the object was removed from the collection. + */ + public boolean removeJGroup( + final jalview.schemabinding.version2.JGroup vJGroup) { + boolean removed = _JGroupList.remove(vJGroup); + return removed; + } + + /** + * Method removeJGroupAt. * * @param index - * @return JGroup + * @return the element removed from the collection */ - public jalview.schemabinding.version2.JGroup removeJGroup(int index) - { - java.lang.Object obj = _JGroupList.elementAt(index); - _JGroupList.removeElementAt(index); + public jalview.schemabinding.version2.JGroup removeJGroupAt( + final int index) { + java.lang.Object obj = this._JGroupList.remove(index); return (jalview.schemabinding.version2.JGroup) obj; - } //-- jalview.schemabinding.version2.JGroup removeJGroup(int) + } /** - * Method removeJSeq - * + * Method removeJSeq. * + * @param vJSeq + * @return true if the object was removed from the collection. + */ + public boolean removeJSeq( + final jalview.schemabinding.version2.JSeq vJSeq) { + boolean removed = _JSeqList.remove(vJSeq); + return removed; + } + + /** + * Method removeJSeqAt. * * @param index - * @return JSeq + * @return the element removed from the collection */ - public jalview.schemabinding.version2.JSeq removeJSeq(int index) - { - java.lang.Object obj = _JSeqList.elementAt(index); - _JSeqList.removeElementAt(index); + public jalview.schemabinding.version2.JSeq removeJSeqAt( + final int index) { + java.lang.Object obj = this._JSeqList.remove(index); return (jalview.schemabinding.version2.JSeq) obj; - } //-- jalview.schemabinding.version2.JSeq removeJSeq(int) + } /** - * Method removeTree - * + * Method removeTree. * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree( + final jalview.schemabinding.version2.Tree vTree) { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. * * @param index - * @return Tree + * @return the element removed from the collection */ - public jalview.schemabinding.version2.Tree removeTree(int index) - { - java.lang.Object obj = _treeList.elementAt(index); - _treeList.removeElementAt(index); + public jalview.schemabinding.version2.Tree removeTreeAt( + final int index) { + java.lang.Object obj = this._treeList.remove(index); return (jalview.schemabinding.version2.Tree) obj; - } //-- jalview.schemabinding.version2.Tree removeTree(int) + } /** - * Method removeUserColours - * + * Method removeUserColours. * + * @param vUserColours + * @return true if the object was removed from the collection. + */ + public boolean removeUserColours( + final jalview.schemabinding.version2.UserColours vUserColours) { + boolean removed = _userColoursList.remove(vUserColours); + return removed; + } + + /** + * Method removeUserColoursAt. * * @param index - * @return UserColours + * @return the element removed from the collection */ - public jalview.schemabinding.version2.UserColours removeUserColours(int index) - { - java.lang.Object obj = _userColoursList.elementAt(index); - _userColoursList.removeElementAt(index); + public jalview.schemabinding.version2.UserColours removeUserColoursAt( + final int index) { + java.lang.Object obj = this._userColoursList.remove(index); return (jalview.schemabinding.version2.UserColours) obj; - } //-- jalview.schemabinding.version2.UserColours removeUserColours(int) + } /** - * Method removeViewport - * + * Method removeViewport. * + * @param vViewport + * @return true if the object was removed from the collection. + */ + public boolean removeViewport( + final jalview.schemabinding.version2.Viewport vViewport) { + boolean removed = _viewportList.remove(vViewport); + return removed; + } + + /** + * Method removeViewportAt. * * @param index - * @return Viewport + * @return the element removed from the collection */ - public jalview.schemabinding.version2.Viewport removeViewport(int index) - { - java.lang.Object obj = _viewportList.elementAt(index); - _viewportList.removeElementAt(index); + public jalview.schemabinding.version2.Viewport removeViewportAt( + final int index) { + java.lang.Object obj = this._viewportList.remove(index); return (jalview.schemabinding.version2.Viewport) obj; - } //-- jalview.schemabinding.version2.Viewport removeViewport(int) + } /** * Sets the value of field 'featureSettings'. * * @param featureSettings the value of field 'featureSettings'. */ - public void setFeatureSettings(jalview.schemabinding.version2.FeatureSettings featureSettings) - { + public void setFeatureSettings( + final jalview.schemabinding.version2.FeatureSettings featureSettings) { this._featureSettings = featureSettings; - } //-- void setFeatureSettings(jalview.schemabinding.version2.FeatureSettings) + } /** - * Method setJGroup - * * * * @param index * @param vJGroup - */ - public void setJGroup(int index, jalview.schemabinding.version2.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _JGroupList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setJGroup( + final int index, + final jalview.schemabinding.version2.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) + "]"); } - _JGroupList.setElementAt(vJGroup, index); - } //-- void setJGroup(int, jalview.schemabinding.version2.JGroup) + + this._JGroupList.set(index, vJGroup); + } /** - * Method setJGroup - * * * - * @param JGroupArray + * @param vJGroupArray */ - public void setJGroup(jalview.schemabinding.version2.JGroup[] JGroupArray) - { + public void setJGroup( + final jalview.schemabinding.version2.JGroup[] vJGroupArray) { //-- copy array - _JGroupList.removeAllElements(); - for (int i = 0; i < JGroupArray.length; i++) { - _JGroupList.addElement(JGroupArray[i]); + _JGroupList.clear(); + + for (int i = 0; i < vJGroupArray.length; i++) { + this._JGroupList.add(vJGroupArray[i]); } - } //-- void setJGroup(jalview.schemabinding.version2.JGroup) + } /** - * Method setJSeq - * * * * @param index * @param vJSeq - */ - public void setJSeq(int index, jalview.schemabinding.version2.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _JSeqList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setJSeq( + final int index, + final jalview.schemabinding.version2.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) + "]"); } - _JSeqList.setElementAt(vJSeq, index); - } //-- void setJSeq(int, jalview.schemabinding.version2.JSeq) + + this._JSeqList.set(index, vJSeq); + } /** - * Method setJSeq * * - * - * @param JSeqArray + * @param vJSeqArray */ - public void setJSeq(jalview.schemabinding.version2.JSeq[] JSeqArray) - { + public void setJSeq( + final jalview.schemabinding.version2.JSeq[] vJSeqArray) { //-- copy array - _JSeqList.removeAllElements(); - for (int i = 0; i < JSeqArray.length; i++) { - _JSeqList.addElement(JSeqArray[i]); + _JSeqList.clear(); + + for (int i = 0; i < vJSeqArray.length; i++) { + this._JSeqList.add(vJSeqArray[i]); } - } //-- void setJSeq(jalview.schemabinding.version2.JSeq) + } /** - * Method setTree - * * * * @param index * @param vTree - */ - public void setTree(int index, jalview.schemabinding.version2.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setTree( + final int index, + final jalview.schemabinding.version2.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) + "]"); } - _treeList.setElementAt(vTree, index); - } //-- void setTree(int, jalview.schemabinding.version2.Tree) + + this._treeList.set(index, vTree); + } /** - * Method setTree - * * * - * @param treeArray + * @param vTreeArray */ - public void setTree(jalview.schemabinding.version2.Tree[] treeArray) - { + public void setTree( + final jalview.schemabinding.version2.Tree[] vTreeArray) { //-- copy array - _treeList.removeAllElements(); - for (int i = 0; i < treeArray.length; i++) { - _treeList.addElement(treeArray[i]); + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) { + this._treeList.add(vTreeArray[i]); } - } //-- void setTree(jalview.schemabinding.version2.Tree) + } /** - * Method setUserColours - * * * * @param index * @param vUserColours - */ - public void setUserColours(int index, jalview.schemabinding.version2.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _userColoursList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setUserColours( + final int index, + final jalview.schemabinding.version2.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) + "]"); } - _userColoursList.setElementAt(vUserColours, index); - } //-- void setUserColours(int, jalview.schemabinding.version2.UserColours) + + this._userColoursList.set(index, vUserColours); + } /** - * Method setUserColours * * - * - * @param userColoursArray + * @param vUserColoursArray */ - public void setUserColours(jalview.schemabinding.version2.UserColours[] userColoursArray) - { + public void setUserColours( + final jalview.schemabinding.version2.UserColours[] vUserColoursArray) { //-- copy array - _userColoursList.removeAllElements(); - for (int i = 0; i < userColoursArray.length; i++) { - _userColoursList.addElement(userColoursArray[i]); + _userColoursList.clear(); + + for (int i = 0; i < vUserColoursArray.length; i++) { + this._userColoursList.add(vUserColoursArray[i]); } - } //-- void setUserColours(jalview.schemabinding.version2.UserColours) + } /** - * Method setViewport - * * * * @param index * @param vViewport - */ - public void setViewport(int index, jalview.schemabinding.version2.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _viewportList.size())) { - throw new IndexOutOfBoundsException(); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setViewport( + final int index, + final jalview.schemabinding.version2.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) + "]"); } - _viewportList.setElementAt(vViewport, index); - } //-- void setViewport(int, jalview.schemabinding.version2.Viewport) + + this._viewportList.set(index, vViewport); + } /** - * Method setViewport - * * * - * @param viewportArray + * @param vViewportArray */ - public void setViewport(jalview.schemabinding.version2.Viewport[] viewportArray) - { + public void setViewport( + final jalview.schemabinding.version2.Viewport[] vViewportArray) { //-- copy array - _viewportList.removeAllElements(); - for (int i = 0; i < viewportArray.length; i++) { - _viewportList.addElement(viewportArray[i]); + _viewportList.clear(); + + for (int i = 0; i < vViewportArray.length; i++) { + this._viewportList.add(vViewportArray[i]); } - } //-- void setViewport(jalview.schemabinding.version2.Viewport) + } /** - * Method unmarshal - * - * + * 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 - { + * @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.schemabinding.version2.JalviewModelSequence + */ + public static jalview.schemabinding.version2.JalviewModelSequence unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewModelSequence.class, reader); - } //-- java.lang.Object unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); - } //-- void validate() + } }