X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2FJSeq.java;h=7c6308eb37b563d034e7fb54b19f0894c1a96bba;hb=0b93ce8953aaec40a5e06f076cd0b7378f44291d;hp=070ef7f076f741d675c92a73678cf3c79dd19cf6;hpb=985f0371b8ea6b3dbb4e1b77d67bba7f7f180b28;p=jalview.git
diff --git a/src/jalview/schemabinding/version2/JSeq.java b/src/jalview/schemabinding/version2/JSeq.java
index 070ef7f..7c6308e 100644
--- a/src/jalview/schemabinding/version2/JSeq.java
+++ b/src/jalview/schemabinding/version2/JSeq.java
@@ -1,22 +1,3 @@
-/*******************************************************************************
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
- * Copyright (C) 2014 The Jalview Authors
- *
- * This file is part of Jalview.
- *
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * Jalview is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with Jalview.
- * If not, see
+ * Note: Just in case the collection contents are changing in another thread, + * we pass a 0-length Array of the correct type into the API call. This way we + * know that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public jalview.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'. @@ -468,6 +566,16 @@ public class JSeq implements java.io.Serializable } /** + * Returns the value of field 'viewreference'. + * + * @return the value of field 'Viewreference'. + */ + public boolean getViewreference() + { + return this._viewreference; + } + + /** * Method hasColour. * * @return true if at least one Colour has been added @@ -508,6 +616,16 @@ public class JSeq implements java.io.Serializable } /** + * Method hasViewreference. + * + * @return true if at least one Viewreference has been added + */ + public boolean hasViewreference() + { + return this._has_viewreference; + } + + /** * Returns the value of field 'hidden'. * * @return the value of field 'Hidden'. @@ -535,6 +653,16 @@ public class JSeq implements java.io.Serializable } /** + * Returns the value of field 'viewreference'. + * + * @return the value of field 'Viewreference'. + */ + public boolean isViewreference() + { + return this._viewreference; + } + + /** * * * @param out @@ -593,6 +721,13 @@ public class JSeq implements java.io.Serializable } /** + */ + public void removeAllRnaViewer() + { + this._rnaViewerList.clear(); + } + + /** * Method removeFeatures. * * @param vFeatures @@ -670,6 +805,32 @@ 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 @@ -838,6 +999,46 @@ 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 @@ -850,6 +1051,18 @@ public class JSeq implements java.io.Serializable } /** + * Sets the value of field 'viewreference'. + * + * @param viewreference + * the value of field 'viewreference'. + */ + public void setViewreference(final boolean viewreference) + { + this._viewreference = viewreference; + this._has_viewreference = true; + } + + /** * Method unmarshal. * * @param reader