2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class JSeq implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
35 * keeps track of state for field: _colour
37 private boolean _has_colour;
45 * keeps track of state for field: _start
47 private boolean _has_start;
55 * keeps track of state for field: _end
57 private boolean _has_end;
62 private java.lang.String _id;
67 private boolean _hidden;
70 * keeps track of state for field: _hidden
72 private boolean _has_hidden;
75 * Field _viewreference.
77 private boolean _viewreference;
80 * keeps track of state for field: _viewreference
82 private boolean _has_viewreference;
85 * Field _featuresList.
87 private java.util.Vector _featuresList;
92 private java.util.Vector _pdbidsList;
95 * Field _hiddenSequencesList.
97 private java.util.Vector _hiddenSequencesList;
100 * Reference to a viewer showing RNA structure
101 * for this sequence. Schema supports one viewer showing
103 * annotations for multiple sequences, though currently only
105 * annotation for one sequence (gapped or trimmed) is used
108 private java.util.Vector _rnaViewerList;
111 * name of the project jar entry that holds the HMM file with
112 * the profile for the sequence
114 private java.lang.String _hmmerProfile;
123 this._featuresList = new java.util.Vector();
124 this._pdbidsList = new java.util.Vector();
125 this._hiddenSequencesList = new java.util.Vector();
126 this._rnaViewerList = new java.util.Vector();
138 * @throws java.lang.IndexOutOfBoundsException if the index
139 * given is outside the bounds of the collection
141 public void addFeatures(
142 final jalview.schemabinding.version2.Features vFeatures)
143 throws java.lang.IndexOutOfBoundsException {
144 this._featuresList.addElement(vFeatures);
152 * @throws java.lang.IndexOutOfBoundsException if the index
153 * given is outside the bounds of the collection
155 public void addFeatures(
157 final jalview.schemabinding.version2.Features vFeatures)
158 throws java.lang.IndexOutOfBoundsException {
159 this._featuresList.add(index, vFeatures);
165 * @param vHiddenSequences
166 * @throws java.lang.IndexOutOfBoundsException if the index
167 * given is outside the bounds of the collection
169 public void addHiddenSequences(
170 final int vHiddenSequences)
171 throws java.lang.IndexOutOfBoundsException {
172 this._hiddenSequencesList.addElement(new java.lang.Integer(vHiddenSequences));
179 * @param vHiddenSequences
180 * @throws java.lang.IndexOutOfBoundsException if the index
181 * given is outside the bounds of the collection
183 public void addHiddenSequences(
185 final int vHiddenSequences)
186 throws java.lang.IndexOutOfBoundsException {
187 this._hiddenSequencesList.add(index, new java.lang.Integer(vHiddenSequences));
194 * @throws java.lang.IndexOutOfBoundsException if the index
195 * given is outside the bounds of the collection
197 public void addPdbids(
198 final jalview.schemabinding.version2.Pdbids vPdbids)
199 throws java.lang.IndexOutOfBoundsException {
200 this._pdbidsList.addElement(vPdbids);
208 * @throws java.lang.IndexOutOfBoundsException if the index
209 * given is outside the bounds of the collection
211 public void addPdbids(
213 final jalview.schemabinding.version2.Pdbids vPdbids)
214 throws java.lang.IndexOutOfBoundsException {
215 this._pdbidsList.add(index, vPdbids);
222 * @throws java.lang.IndexOutOfBoundsException if the index
223 * given is outside the bounds of the collection
225 public void addRnaViewer(
226 final jalview.schemabinding.version2.RnaViewer vRnaViewer)
227 throws java.lang.IndexOutOfBoundsException {
228 this._rnaViewerList.addElement(vRnaViewer);
236 * @throws java.lang.IndexOutOfBoundsException if the index
237 * given is outside the bounds of the collection
239 public void addRnaViewer(
241 final jalview.schemabinding.version2.RnaViewer vRnaViewer)
242 throws java.lang.IndexOutOfBoundsException {
243 this._rnaViewerList.add(index, vRnaViewer);
248 public void deleteColour(
250 this._has_colour= false;
255 public void deleteEnd(
257 this._has_end= false;
262 public void deleteHidden(
264 this._has_hidden= false;
269 public void deleteStart(
271 this._has_start= false;
276 public void deleteViewreference(
278 this._has_viewreference= false;
282 * Method enumerateFeatures.
284 * @return an Enumeration over all
285 * jalview.schemabinding.version2.Features elements
287 public java.util.Enumeration enumerateFeatures(
289 return this._featuresList.elements();
293 * Method enumerateHiddenSequences.
295 * @return an Enumeration over all int elements
297 public java.util.Enumeration enumerateHiddenSequences(
299 return this._hiddenSequencesList.elements();
303 * Method enumeratePdbids.
305 * @return an Enumeration over all
306 * jalview.schemabinding.version2.Pdbids elements
308 public java.util.Enumeration enumeratePdbids(
310 return this._pdbidsList.elements();
314 * Method enumerateRnaViewer.
316 * @return an Enumeration over all
317 * jalview.schemabinding.version2.RnaViewer elements
319 public java.util.Enumeration enumerateRnaViewer(
321 return this._rnaViewerList.elements();
325 * Returns the value of field 'colour'.
327 * @return the value of field 'Colour'.
329 public int getColour(
335 * Returns the value of field 'end'.
337 * @return the value of field 'End'.
345 * Method getFeatures.
348 * @throws java.lang.IndexOutOfBoundsException if the index
349 * given is outside the bounds of the collection
350 * @return the value of the
351 * jalview.schemabinding.version2.Features at the given index
353 public jalview.schemabinding.version2.Features getFeatures(
355 throws java.lang.IndexOutOfBoundsException {
356 // check bounds for index
357 if (index < 0 || index >= this._featuresList.size()) {
358 throw new IndexOutOfBoundsException("getFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
361 return (jalview.schemabinding.version2.Features) _featuresList.get(index);
365 * Method getFeatures.Returns the contents of the collection in
366 * an Array. <p>Note: Just in case the collection contents
367 * are changing in another thread, we pass a 0-length Array of
368 * the correct type into the API call. This way we <i>know</i>
369 * that the Array returned is of exactly the correct length.
371 * @return this collection as an Array
373 public jalview.schemabinding.version2.Features[] getFeatures(
375 jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
376 return (jalview.schemabinding.version2.Features[]) this._featuresList.toArray(array);
380 * Method getFeaturesCount.
382 * @return the size of this collection
384 public int getFeaturesCount(
386 return this._featuresList.size();
390 * Returns the value of field 'hidden'.
392 * @return the value of field 'Hidden'.
394 public boolean getHidden(
400 * Method getHiddenSequences.
403 * @throws java.lang.IndexOutOfBoundsException if the index
404 * given is outside the bounds of the collection
405 * @return the value of the int at the given index
407 public int getHiddenSequences(
409 throws java.lang.IndexOutOfBoundsException {
410 // check bounds for index
411 if (index < 0 || index >= this._hiddenSequencesList.size()) {
412 throw new IndexOutOfBoundsException("getHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
415 return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
419 * Method getHiddenSequences.Returns the contents of the
420 * collection in an Array.
422 * @return this collection as an Array
424 public int[] getHiddenSequences(
426 int size = this._hiddenSequencesList.size();
427 int[] array = new int[size];
428 java.util.Iterator iter = _hiddenSequencesList.iterator();
429 for (int index = 0; index < size; index++) {
430 array[index] = ((java.lang.Integer) iter.next()).intValue();
436 * Method getHiddenSequencesCount.
438 * @return the size of this collection
440 public int getHiddenSequencesCount(
442 return this._hiddenSequencesList.size();
446 * Returns the value of field 'hmmerProfile'. The field
447 * 'hmmerProfile' has the following description: name of the
448 * project jar entry that holds the HMM file with the profile
451 * @return the value of field 'HmmerProfile'.
453 public java.lang.String getHmmerProfile(
455 return this._hmmerProfile;
459 * Returns the value of field 'id'.
461 * @return the value of field 'Id'.
463 public java.lang.String getId(
472 * @throws java.lang.IndexOutOfBoundsException if the index
473 * given is outside the bounds of the collection
474 * @return the value of the
475 * jalview.schemabinding.version2.Pdbids at the given index
477 public jalview.schemabinding.version2.Pdbids getPdbids(
479 throws java.lang.IndexOutOfBoundsException {
480 // check bounds for index
481 if (index < 0 || index >= this._pdbidsList.size()) {
482 throw new IndexOutOfBoundsException("getPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
485 return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
489 * Method getPdbids.Returns the contents of the collection in
490 * an Array. <p>Note: Just in case the collection contents
491 * are changing in another thread, we pass a 0-length Array of
492 * the correct type into the API call. This way we <i>know</i>
493 * that the Array returned is of exactly the correct length.
495 * @return this collection as an Array
497 public jalview.schemabinding.version2.Pdbids[] getPdbids(
499 jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
500 return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList.toArray(array);
504 * Method getPdbidsCount.
506 * @return the size of this collection
508 public int getPdbidsCount(
510 return this._pdbidsList.size();
514 * Method getRnaViewer.
517 * @throws java.lang.IndexOutOfBoundsException if the index
518 * given is outside the bounds of the collection
519 * @return the value of the
520 * jalview.schemabinding.version2.RnaViewer at the given index
522 public jalview.schemabinding.version2.RnaViewer getRnaViewer(
524 throws java.lang.IndexOutOfBoundsException {
525 // check bounds for index
526 if (index < 0 || index >= this._rnaViewerList.size()) {
527 throw new IndexOutOfBoundsException("getRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]");
530 return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList.get(index);
534 * Method getRnaViewer.Returns the contents of the collection
535 * in an Array. <p>Note: Just in case the collection contents
536 * are changing in another thread, we pass a 0-length Array of
537 * the correct type into the API call. This way we <i>know</i>
538 * that the Array returned is of exactly the correct length.
540 * @return this collection as an Array
542 public jalview.schemabinding.version2.RnaViewer[] getRnaViewer(
544 jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0];
545 return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList.toArray(array);
549 * Method getRnaViewerCount.
551 * @return the size of this collection
553 public int getRnaViewerCount(
555 return this._rnaViewerList.size();
559 * Returns the value of field 'start'.
561 * @return the value of field 'Start'.
569 * Returns the value of field 'viewreference'.
571 * @return the value of field 'Viewreference'.
573 public boolean getViewreference(
575 return this._viewreference;
581 * @return true if at least one Colour has been added
583 public boolean hasColour(
585 return this._has_colour;
591 * @return true if at least one End has been added
593 public boolean hasEnd(
595 return this._has_end;
601 * @return true if at least one Hidden has been added
603 public boolean hasHidden(
605 return this._has_hidden;
611 * @return true if at least one Start has been added
613 public boolean hasStart(
615 return this._has_start;
619 * Method hasViewreference.
621 * @return true if at least one Viewreference has been added
623 public boolean hasViewreference(
625 return this._has_viewreference;
629 * Returns the value of field 'hidden'.
631 * @return the value of field 'Hidden'.
633 public boolean isHidden(
641 * @return true if this object is valid according to the schema
643 public boolean isValid(
647 } catch (org.exolab.castor.xml.ValidationException vex) {
654 * Returns the value of field 'viewreference'.
656 * @return the value of field 'Viewreference'.
658 public boolean isViewreference(
660 return this._viewreference;
667 * @throws org.exolab.castor.xml.MarshalException if object is
668 * null or if any SAXException is thrown during marshaling
669 * @throws org.exolab.castor.xml.ValidationException if this
670 * object is an invalid instance according to the schema
673 final java.io.Writer out)
674 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
675 Marshaller.marshal(this, out);
682 * @throws java.io.IOException if an IOException occurs during
684 * @throws org.exolab.castor.xml.ValidationException if this
685 * object is an invalid instance according to the schema
686 * @throws org.exolab.castor.xml.MarshalException if object is
687 * null or if any SAXException is thrown during marshaling
690 final org.xml.sax.ContentHandler handler)
691 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
692 Marshaller.marshal(this, handler);
697 public void removeAllFeatures(
699 this._featuresList.clear();
704 public void removeAllHiddenSequences(
706 this._hiddenSequencesList.clear();
711 public void removeAllPdbids(
713 this._pdbidsList.clear();
718 public void removeAllRnaViewer(
720 this._rnaViewerList.clear();
724 * Method removeFeatures.
727 * @return true if the object was removed from the collection.
729 public boolean removeFeatures(
730 final jalview.schemabinding.version2.Features vFeatures) {
731 boolean removed = _featuresList.remove(vFeatures);
736 * Method removeFeaturesAt.
739 * @return the element removed from the collection
741 public jalview.schemabinding.version2.Features removeFeaturesAt(
743 java.lang.Object obj = this._featuresList.remove(index);
744 return (jalview.schemabinding.version2.Features) obj;
748 * Method removeHiddenSequences.
750 * @param vHiddenSequences
751 * @return true if the object was removed from the collection.
753 public boolean removeHiddenSequences(
754 final int vHiddenSequences) {
755 boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(vHiddenSequences));
760 * Method removeHiddenSequencesAt.
763 * @return the element removed from the collection
765 public int removeHiddenSequencesAt(
767 java.lang.Object obj = this._hiddenSequencesList.remove(index);
768 return ((java.lang.Integer) obj).intValue();
772 * Method removePdbids.
775 * @return true if the object was removed from the collection.
777 public boolean removePdbids(
778 final jalview.schemabinding.version2.Pdbids vPdbids) {
779 boolean removed = _pdbidsList.remove(vPdbids);
784 * Method removePdbidsAt.
787 * @return the element removed from the collection
789 public jalview.schemabinding.version2.Pdbids removePdbidsAt(
791 java.lang.Object obj = this._pdbidsList.remove(index);
792 return (jalview.schemabinding.version2.Pdbids) obj;
796 * Method removeRnaViewer.
799 * @return true if the object was removed from the collection.
801 public boolean removeRnaViewer(
802 final jalview.schemabinding.version2.RnaViewer vRnaViewer) {
803 boolean removed = _rnaViewerList.remove(vRnaViewer);
808 * Method removeRnaViewerAt.
811 * @return the element removed from the collection
813 public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt(
815 java.lang.Object obj = this._rnaViewerList.remove(index);
816 return (jalview.schemabinding.version2.RnaViewer) obj;
820 * Sets the value of field 'colour'.
822 * @param colour the value of field 'colour'.
824 public void setColour(
826 this._colour = colour;
827 this._has_colour = true;
831 * Sets the value of field 'end'.
833 * @param end the value of field 'end'.
838 this._has_end = true;
846 * @throws java.lang.IndexOutOfBoundsException if the index
847 * given is outside the bounds of the collection
849 public void setFeatures(
851 final jalview.schemabinding.version2.Features vFeatures)
852 throws java.lang.IndexOutOfBoundsException {
853 // check bounds for index
854 if (index < 0 || index >= this._featuresList.size()) {
855 throw new IndexOutOfBoundsException("setFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
858 this._featuresList.set(index, vFeatures);
864 * @param vFeaturesArray
866 public void setFeatures(
867 final jalview.schemabinding.version2.Features[] vFeaturesArray) {
869 _featuresList.clear();
871 for (int i = 0; i < vFeaturesArray.length; i++) {
872 this._featuresList.add(vFeaturesArray[i]);
877 * Sets the value of field 'hidden'.
879 * @param hidden the value of field 'hidden'.
881 public void setHidden(
882 final boolean hidden) {
883 this._hidden = hidden;
884 this._has_hidden = true;
891 * @param vHiddenSequences
892 * @throws java.lang.IndexOutOfBoundsException if the index
893 * given is outside the bounds of the collection
895 public void setHiddenSequences(
897 final int vHiddenSequences)
898 throws java.lang.IndexOutOfBoundsException {
899 // check bounds for index
900 if (index < 0 || index >= this._hiddenSequencesList.size()) {
901 throw new IndexOutOfBoundsException("setHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
904 this._hiddenSequencesList.set(index, new java.lang.Integer(vHiddenSequences));
910 * @param vHiddenSequencesArray
912 public void setHiddenSequences(
913 final int[] vHiddenSequencesArray) {
915 _hiddenSequencesList.clear();
917 for (int i = 0; i < vHiddenSequencesArray.length; i++) {
918 this._hiddenSequencesList.add(new java.lang.Integer(vHiddenSequencesArray[i]));
923 * Sets the value of field 'hmmerProfile'. The field
924 * 'hmmerProfile' has the following description: name of the
925 * project jar entry that holds the HMM file with the profile
928 * @param hmmerProfile the value of field 'hmmerProfile'.
930 public void setHmmerProfile(
931 final java.lang.String hmmerProfile) {
932 this._hmmerProfile = hmmerProfile;
936 * Sets the value of field 'id'.
938 * @param id the value of field 'id'.
941 final java.lang.String id) {
950 * @throws java.lang.IndexOutOfBoundsException if the index
951 * given is outside the bounds of the collection
953 public void setPdbids(
955 final jalview.schemabinding.version2.Pdbids vPdbids)
956 throws java.lang.IndexOutOfBoundsException {
957 // check bounds for index
958 if (index < 0 || index >= this._pdbidsList.size()) {
959 throw new IndexOutOfBoundsException("setPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
962 this._pdbidsList.set(index, vPdbids);
968 * @param vPdbidsArray
970 public void setPdbids(
971 final jalview.schemabinding.version2.Pdbids[] vPdbidsArray) {
975 for (int i = 0; i < vPdbidsArray.length; i++) {
976 this._pdbidsList.add(vPdbidsArray[i]);
985 * @throws java.lang.IndexOutOfBoundsException if the index
986 * given is outside the bounds of the collection
988 public void setRnaViewer(
990 final jalview.schemabinding.version2.RnaViewer vRnaViewer)
991 throws java.lang.IndexOutOfBoundsException {
992 // check bounds for index
993 if (index < 0 || index >= this._rnaViewerList.size()) {
994 throw new IndexOutOfBoundsException("setRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]");
997 this._rnaViewerList.set(index, vRnaViewer);
1003 * @param vRnaViewerArray
1005 public void setRnaViewer(
1006 final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray) {
1008 _rnaViewerList.clear();
1010 for (int i = 0; i < vRnaViewerArray.length; i++) {
1011 this._rnaViewerList.add(vRnaViewerArray[i]);
1016 * Sets the value of field 'start'.
1018 * @param start the value of field 'start'.
1020 public void setStart(
1022 this._start = start;
1023 this._has_start = true;
1027 * Sets the value of field 'viewreference'.
1029 * @param viewreference the value of field 'viewreference'.
1031 public void setViewreference(
1032 final boolean viewreference) {
1033 this._viewreference = viewreference;
1034 this._has_viewreference = true;
1041 * @throws org.exolab.castor.xml.MarshalException if object is
1042 * null or if any SAXException is thrown during marshaling
1043 * @throws org.exolab.castor.xml.ValidationException if this
1044 * object is an invalid instance according to the schema
1045 * @return the unmarshaled jalview.schemabinding.version2.JSeq
1047 public static jalview.schemabinding.version2.JSeq unmarshal(
1048 final java.io.Reader reader)
1049 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1050 return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(jalview.schemabinding.version2.JSeq.class, reader);
1056 * @throws org.exolab.castor.xml.ValidationException if this
1057 * object is an invalid instance according to the schema
1059 public void validate(
1061 throws org.exolab.castor.xml.ValidationException {
1062 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1063 validator.validate(this);