X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2FJSeq.java;h=193b00598a6972fafb1db74ba35740516a23abeb;hb=5247711ab4a6453614e2a9fb9307e6bae6a7b4a9;hp=65b11244729d61b90da58d7e04a9de5f77325cd8;hpb=797df64fa2a0a30773d0f48f5494d4155e5a8be3;p=jalview.git diff --git a/src/jalview/schemabinding/version2/JSeq.java b/src/jalview/schemabinding/version2/JSeq.java index 65b1124..193b005 100644 --- a/src/jalview/schemabinding/version2/JSeq.java +++ b/src/jalview/schemabinding/version2/JSeq.java @@ -1,20 +1,3 @@ -/******************************************************************************* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle - * - * 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 . - *******************************************************************************/ /* * This class was automatically generated with * Castor 1.1, using an XML @@ -103,6 +86,17 @@ public class JSeq implements java.io.Serializable { */ private java.util.Vector _hiddenSequencesList; + /** + * Reference to a viewer showing RNA structure + * for this sequence. Schema supports one viewer showing + * multiple + * annotations for multiple sequences, though currently only + * one + * annotation for one sequence (gapped or trimmed) is used + * + */ + private java.util.Vector _rnaViewerList; + //----------------/ //- Constructors -/ @@ -113,6 +107,7 @@ public class JSeq implements java.io.Serializable { this._featuresList = new java.util.Vector(); this._pdbidsList = new java.util.Vector(); this._hiddenSequencesList = new java.util.Vector(); + this._rnaViewerList = new java.util.Vector(); } @@ -205,6 +200,34 @@ public class JSeq implements java.io.Serializable { } /** + * + * + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addRnaViewer( + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException { + this._rnaViewerList.addElement(vRnaViewer); + } + + /** + * + * + * @param index + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addRnaViewer( + final int index, + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException { + this._rnaViewerList.add(index, vRnaViewer); + } + + /** */ public void deleteColour( ) { @@ -265,6 +288,17 @@ public class JSeq implements java.io.Serializable { } /** + * Method enumerateRnaViewer. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.RnaViewer elements + */ + public java.util.Enumeration enumerateRnaViewer( + ) { + return this._rnaViewerList.elements(); + } + + /** * Returns the value of field 'colour'. * * @return the value of field 'Colour'. @@ -441,6 +475,51 @@ public class JSeq implements java.io.Serializable { } /** + * Method getRnaViewer. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * jalview.schemabinding.version2.RnaViewer at the given index + */ + public jalview.schemabinding.version2.RnaViewer getRnaViewer( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._rnaViewerList.size()) { + throw new IndexOutOfBoundsException("getRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList.get(index); + } + + /** + * Method getRnaViewer.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.schemabinding.version2.RnaViewer[] getRnaViewer( + ) { + jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0]; + return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList.toArray(array); + } + + /** + * Method getRnaViewerCount. + * + * @return the size of this collection + */ + public int getRnaViewerCount( + ) { + return this._rnaViewerList.size(); + } + + /** * Returns the value of field 'start'. * * @return the value of field 'Start'. @@ -569,6 +648,13 @@ public class JSeq implements java.io.Serializable { } /** + */ + public void removeAllRnaViewer( + ) { + this._rnaViewerList.clear(); + } + + /** * Method removeFeatures. * * @param vFeatures @@ -641,6 +727,30 @@ public class JSeq implements java.io.Serializable { } /** + * Method removeRnaViewer. + * + * @param vRnaViewer + * @return true if the object was removed from the collection. + */ + public boolean removeRnaViewer( + final jalview.schemabinding.version2.RnaViewer vRnaViewer) { + boolean removed = _rnaViewerList.remove(vRnaViewer); + return removed; + } + + /** + * Method removeRnaViewerAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt( + final int index) { + java.lang.Object obj = this._rnaViewerList.remove(index); + return (jalview.schemabinding.version2.RnaViewer) obj; + } + + /** * Sets the value of field 'colour'. * * @param colour the value of field 'colour'. @@ -789,6 +899,41 @@ public class JSeq implements java.io.Serializable { } /** + * + * + * @param index + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setRnaViewer( + final int index, + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._rnaViewerList.size()) { + throw new IndexOutOfBoundsException("setRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]"); + } + + this._rnaViewerList.set(index, vRnaViewer); + } + + /** + * + * + * @param vRnaViewerArray + */ + public void setRnaViewer( + final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray) { + //-- copy array + _rnaViewerList.clear(); + + for (int i = 0; i < vRnaViewerArray.length; i++) { + this._rnaViewerList.add(vRnaViewerArray[i]); + } + } + + /** * Sets the value of field 'start'. * * @param start the value of field 'start'.