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 for this sequence. Schema
101 * supports one viewer showing multiple annotations for multiple sequences,
102 * though currently only one annotation for one sequence (gapped or trimmed)
106 private java.util.Vector _rnaViewerList;
115 this._featuresList = new java.util.Vector();
116 this._pdbidsList = new java.util.Vector();
117 this._hiddenSequencesList = new java.util.Vector();
118 this._rnaViewerList = new java.util.Vector();
129 * @throws java.lang.IndexOutOfBoundsException
130 * if the index given is outside the bounds of the collection
132 public void addFeatures(
133 final jalview.schemabinding.version2.Features vFeatures)
134 throws java.lang.IndexOutOfBoundsException
136 this._featuresList.addElement(vFeatures);
144 * @throws java.lang.IndexOutOfBoundsException
145 * if the index given is outside the bounds of the collection
147 public void addFeatures(final int index,
148 final jalview.schemabinding.version2.Features vFeatures)
149 throws java.lang.IndexOutOfBoundsException
151 this._featuresList.add(index, vFeatures);
157 * @param vHiddenSequences
158 * @throws java.lang.IndexOutOfBoundsException
159 * if the index given is outside the bounds of the collection
161 public void addHiddenSequences(final int vHiddenSequences)
162 throws java.lang.IndexOutOfBoundsException
164 this._hiddenSequencesList.addElement(new java.lang.Integer(
172 * @param vHiddenSequences
173 * @throws java.lang.IndexOutOfBoundsException
174 * if the index given is outside the bounds of the collection
176 public void addHiddenSequences(final int index, final int vHiddenSequences)
177 throws java.lang.IndexOutOfBoundsException
179 this._hiddenSequencesList.add(index, new java.lang.Integer(
187 * @throws java.lang.IndexOutOfBoundsException
188 * if the index given is outside the bounds of the collection
190 public void addPdbids(final jalview.schemabinding.version2.Pdbids vPdbids)
191 throws java.lang.IndexOutOfBoundsException
193 this._pdbidsList.addElement(vPdbids);
201 * @throws java.lang.IndexOutOfBoundsException
202 * if the index given is outside the bounds of the collection
204 public void addPdbids(final int index,
205 final jalview.schemabinding.version2.Pdbids vPdbids)
206 throws java.lang.IndexOutOfBoundsException
208 this._pdbidsList.add(index, vPdbids);
215 * @throws java.lang.IndexOutOfBoundsException
216 * if the index given is outside the bounds of the collection
218 public void addRnaViewer(
219 final jalview.schemabinding.version2.RnaViewer vRnaViewer)
220 throws java.lang.IndexOutOfBoundsException
222 this._rnaViewerList.addElement(vRnaViewer);
230 * @throws java.lang.IndexOutOfBoundsException
231 * if the index given is outside the bounds of the collection
233 public void addRnaViewer(final int index,
234 final jalview.schemabinding.version2.RnaViewer vRnaViewer)
235 throws java.lang.IndexOutOfBoundsException
237 this._rnaViewerList.add(index, vRnaViewer);
242 public void deleteColour()
244 this._has_colour = false;
249 public void deleteEnd()
251 this._has_end = false;
256 public void deleteHidden()
258 this._has_hidden = false;
263 public void deleteStart()
265 this._has_start = false;
270 public void deleteViewreference()
272 this._has_viewreference = false;
276 * Method enumerateFeatures.
278 * @return an Enumeration over all jalview.schemabinding.version2.Features
281 public java.util.Enumeration enumerateFeatures()
283 return this._featuresList.elements();
287 * Method enumerateHiddenSequences.
289 * @return an Enumeration over all int elements
291 public java.util.Enumeration enumerateHiddenSequences()
293 return this._hiddenSequencesList.elements();
297 * Method enumeratePdbids.
299 * @return an Enumeration over all jalview.schemabinding.version2.Pdbids
302 public java.util.Enumeration enumeratePdbids()
304 return this._pdbidsList.elements();
308 * Method enumerateRnaViewer.
310 * @return an Enumeration over all jalview.schemabinding.version2.RnaViewer
313 public java.util.Enumeration enumerateRnaViewer()
315 return this._rnaViewerList.elements();
319 * Returns the value of field 'colour'.
321 * @return the value of field 'Colour'.
323 public int getColour()
329 * Returns the value of field 'end'.
331 * @return the value of field 'End'.
339 * Method getFeatures.
342 * @throws java.lang.IndexOutOfBoundsException
343 * if the index given is outside the bounds of the collection
344 * @return the value of the jalview.schemabinding.version2.Features at the
347 public jalview.schemabinding.version2.Features getFeatures(final int index)
348 throws java.lang.IndexOutOfBoundsException
350 // check bounds for index
351 if (index < 0 || index >= this._featuresList.size())
353 throw new IndexOutOfBoundsException("getFeatures: Index value '"
354 + index + "' not in range [0.."
355 + (this._featuresList.size() - 1) + "]");
358 return (jalview.schemabinding.version2.Features) _featuresList
363 * Method getFeatures.Returns the contents of the collection in an Array.
365 * Note: Just in case the collection contents are changing in another thread,
366 * we pass a 0-length Array of the correct type into the API call. This way we
367 * <i>know</i> that the Array returned is of exactly the correct length.
369 * @return this collection as an Array
371 public jalview.schemabinding.version2.Features[] getFeatures()
373 jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
374 return (jalview.schemabinding.version2.Features[]) this._featuresList
379 * Method getFeaturesCount.
381 * @return the size of this collection
383 public int getFeaturesCount()
385 return this._featuresList.size();
389 * Returns the value of field 'hidden'.
391 * @return the value of field 'Hidden'.
393 public boolean getHidden()
399 * Method getHiddenSequences.
402 * @throws java.lang.IndexOutOfBoundsException
403 * if the index given is outside the bounds of the collection
404 * @return the value of the int at the given index
406 public int getHiddenSequences(final int index)
407 throws java.lang.IndexOutOfBoundsException
409 // check bounds for index
410 if (index < 0 || index >= this._hiddenSequencesList.size())
412 throw new IndexOutOfBoundsException(
413 "getHiddenSequences: Index value '" + index
414 + "' not in range [0.."
415 + (this._hiddenSequencesList.size() - 1) + "]");
418 return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
422 * Method getHiddenSequences.Returns the contents of the collection in an
425 * @return this collection as an Array
427 public int[] getHiddenSequences()
429 int size = this._hiddenSequencesList.size();
430 int[] array = new int[size];
431 java.util.Iterator iter = _hiddenSequencesList.iterator();
432 for (int index = 0; index < size; index++)
434 array[index] = ((java.lang.Integer) iter.next()).intValue();
440 * Method getHiddenSequencesCount.
442 * @return the size of this collection
444 public int getHiddenSequencesCount()
446 return this._hiddenSequencesList.size();
450 * Returns the value of field 'id'.
452 * @return the value of field 'Id'.
454 public java.lang.String getId()
463 * @throws java.lang.IndexOutOfBoundsException
464 * if the index given is outside the bounds of the collection
465 * @return the value of the jalview.schemabinding.version2.Pdbids at the given
468 public jalview.schemabinding.version2.Pdbids getPdbids(final int index)
469 throws java.lang.IndexOutOfBoundsException
471 // check bounds for index
472 if (index < 0 || index >= this._pdbidsList.size())
474 throw new IndexOutOfBoundsException("getPdbids: Index value '"
475 + index + "' not in range [0.."
476 + (this._pdbidsList.size() - 1) + "]");
479 return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
483 * Method getPdbids.Returns the contents of the collection in an Array.
485 * Note: Just in case the collection contents are changing in another thread,
486 * we pass a 0-length Array of the correct type into the API call. This way we
487 * <i>know</i> that the Array returned is of exactly the correct length.
489 * @return this collection as an Array
491 public jalview.schemabinding.version2.Pdbids[] getPdbids()
493 jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
494 return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList
499 * Method getPdbidsCount.
501 * @return the size of this collection
503 public int getPdbidsCount()
505 return this._pdbidsList.size();
509 * Method getRnaViewer.
512 * @throws java.lang.IndexOutOfBoundsException
513 * if the index given is outside the bounds of the collection
514 * @return the value of the jalview.schemabinding.version2.RnaViewer at the
517 public jalview.schemabinding.version2.RnaViewer getRnaViewer(
518 final int index) throws java.lang.IndexOutOfBoundsException
520 // check bounds for index
521 if (index < 0 || index >= this._rnaViewerList.size())
523 throw new IndexOutOfBoundsException("getRnaViewer: Index value '"
524 + index + "' not in range [0.."
525 + (this._rnaViewerList.size() - 1) + "]");
528 return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList
533 * Method getRnaViewer.Returns the contents of the collection in an Array.
535 * Note: Just in case the collection contents are changing in another thread,
536 * we pass a 0-length Array of the correct type into the API call. This way we
537 * <i>know</i> that the Array returned is of exactly the correct length.
539 * @return this collection as an Array
541 public jalview.schemabinding.version2.RnaViewer[] getRnaViewer()
543 jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0];
544 return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList
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'.
563 public int getStart()
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()
648 } catch (org.exolab.castor.xml.ValidationException vex)
656 * Returns the value of field 'viewreference'.
658 * @return the value of field 'Viewreference'.
660 public boolean isViewreference()
662 return this._viewreference;
669 * @throws org.exolab.castor.xml.MarshalException
670 * if object is null or if any SAXException is thrown during
672 * @throws org.exolab.castor.xml.ValidationException
673 * if this object is an invalid instance according to the schema
675 public void marshal(final java.io.Writer out)
676 throws org.exolab.castor.xml.MarshalException,
677 org.exolab.castor.xml.ValidationException
679 Marshaller.marshal(this, out);
686 * @throws java.io.IOException
687 * if an IOException occurs during marshaling
688 * @throws org.exolab.castor.xml.ValidationException
689 * if this object is an invalid instance according to the schema
690 * @throws org.exolab.castor.xml.MarshalException
691 * if object is null or if any SAXException is thrown during
694 public void marshal(final org.xml.sax.ContentHandler handler)
695 throws java.io.IOException,
696 org.exolab.castor.xml.MarshalException,
697 org.exolab.castor.xml.ValidationException
699 Marshaller.marshal(this, handler);
704 public void removeAllFeatures()
706 this._featuresList.clear();
711 public void removeAllHiddenSequences()
713 this._hiddenSequencesList.clear();
718 public void removeAllPdbids()
720 this._pdbidsList.clear();
725 public void removeAllRnaViewer()
727 this._rnaViewerList.clear();
731 * Method removeFeatures.
734 * @return true if the object was removed from the collection.
736 public boolean removeFeatures(
737 final jalview.schemabinding.version2.Features vFeatures)
739 boolean removed = _featuresList.remove(vFeatures);
744 * Method removeFeaturesAt.
747 * @return the element removed from the collection
749 public jalview.schemabinding.version2.Features removeFeaturesAt(
752 java.lang.Object obj = this._featuresList.remove(index);
753 return (jalview.schemabinding.version2.Features) obj;
757 * Method removeHiddenSequences.
759 * @param vHiddenSequences
760 * @return true if the object was removed from the collection.
762 public boolean removeHiddenSequences(final int vHiddenSequences)
764 boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(
770 * Method removeHiddenSequencesAt.
773 * @return the element removed from the collection
775 public int removeHiddenSequencesAt(final int index)
777 java.lang.Object obj = this._hiddenSequencesList.remove(index);
778 return ((java.lang.Integer) obj).intValue();
782 * Method removePdbids.
785 * @return true if the object was removed from the collection.
787 public boolean removePdbids(
788 final jalview.schemabinding.version2.Pdbids vPdbids)
790 boolean removed = _pdbidsList.remove(vPdbids);
795 * Method removePdbidsAt.
798 * @return the element removed from the collection
800 public jalview.schemabinding.version2.Pdbids removePdbidsAt(
803 java.lang.Object obj = this._pdbidsList.remove(index);
804 return (jalview.schemabinding.version2.Pdbids) obj;
808 * Method removeRnaViewer.
811 * @return true if the object was removed from the collection.
813 public boolean removeRnaViewer(
814 final jalview.schemabinding.version2.RnaViewer vRnaViewer)
816 boolean removed = _rnaViewerList.remove(vRnaViewer);
821 * Method removeRnaViewerAt.
824 * @return the element removed from the collection
826 public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt(
829 java.lang.Object obj = this._rnaViewerList.remove(index);
830 return (jalview.schemabinding.version2.RnaViewer) obj;
834 * Sets the value of field 'colour'.
837 * the value of field 'colour'.
839 public void setColour(final int colour)
841 this._colour = colour;
842 this._has_colour = true;
846 * Sets the value of field 'end'.
849 * the value of field 'end'.
851 public void setEnd(final int end)
854 this._has_end = true;
862 * @throws java.lang.IndexOutOfBoundsException
863 * if the index given is outside the bounds of the collection
865 public void setFeatures(final int index,
866 final jalview.schemabinding.version2.Features vFeatures)
867 throws java.lang.IndexOutOfBoundsException
869 // check bounds for index
870 if (index < 0 || index >= this._featuresList.size())
872 throw new IndexOutOfBoundsException("setFeatures: Index value '"
873 + index + "' not in range [0.."
874 + (this._featuresList.size() - 1) + "]");
877 this._featuresList.set(index, vFeatures);
883 * @param vFeaturesArray
885 public void setFeatures(
886 final jalview.schemabinding.version2.Features[] vFeaturesArray)
889 _featuresList.clear();
891 for (int i = 0; i < vFeaturesArray.length; i++)
893 this._featuresList.add(vFeaturesArray[i]);
898 * Sets the value of field 'hidden'.
901 * the value of field 'hidden'.
903 public void setHidden(final boolean hidden)
905 this._hidden = hidden;
906 this._has_hidden = true;
913 * @param vHiddenSequences
914 * @throws java.lang.IndexOutOfBoundsException
915 * if the index given is outside the bounds of the collection
917 public void setHiddenSequences(final int index, final int vHiddenSequences)
918 throws java.lang.IndexOutOfBoundsException
920 // check bounds for index
921 if (index < 0 || index >= this._hiddenSequencesList.size())
923 throw new IndexOutOfBoundsException(
924 "setHiddenSequences: Index value '" + index
925 + "' not in range [0.."
926 + (this._hiddenSequencesList.size() - 1) + "]");
929 this._hiddenSequencesList.set(index, new java.lang.Integer(
936 * @param vHiddenSequencesArray
938 public void setHiddenSequences(final int[] vHiddenSequencesArray)
941 _hiddenSequencesList.clear();
943 for (int i = 0; i < vHiddenSequencesArray.length; i++)
945 this._hiddenSequencesList.add(new java.lang.Integer(
946 vHiddenSequencesArray[i]));
951 * Sets the value of field 'id'.
954 * the value of field 'id'.
956 public void setId(final java.lang.String id)
966 * @throws java.lang.IndexOutOfBoundsException
967 * if the index given is outside the bounds of the collection
969 public void setPdbids(final int index,
970 final jalview.schemabinding.version2.Pdbids vPdbids)
971 throws java.lang.IndexOutOfBoundsException
973 // check bounds for index
974 if (index < 0 || index >= this._pdbidsList.size())
976 throw new IndexOutOfBoundsException("setPdbids: Index value '"
977 + index + "' not in range [0.."
978 + (this._pdbidsList.size() - 1) + "]");
981 this._pdbidsList.set(index, vPdbids);
987 * @param vPdbidsArray
989 public void setPdbids(
990 final jalview.schemabinding.version2.Pdbids[] vPdbidsArray)
995 for (int i = 0; i < vPdbidsArray.length; i++)
997 this._pdbidsList.add(vPdbidsArray[i]);
1006 * @throws java.lang.IndexOutOfBoundsException
1007 * if the index given is outside the bounds of the collection
1009 public void setRnaViewer(final int index,
1010 final jalview.schemabinding.version2.RnaViewer vRnaViewer)
1011 throws java.lang.IndexOutOfBoundsException
1013 // check bounds for index
1014 if (index < 0 || index >= this._rnaViewerList.size())
1016 throw new IndexOutOfBoundsException("setRnaViewer: Index value '"
1017 + index + "' not in range [0.."
1018 + (this._rnaViewerList.size() - 1) + "]");
1021 this._rnaViewerList.set(index, vRnaViewer);
1027 * @param vRnaViewerArray
1029 public void setRnaViewer(
1030 final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray)
1033 _rnaViewerList.clear();
1035 for (int i = 0; i < vRnaViewerArray.length; i++)
1037 this._rnaViewerList.add(vRnaViewerArray[i]);
1042 * Sets the value of field 'start'.
1045 * the value of field 'start'.
1047 public void setStart(final int start)
1049 this._start = start;
1050 this._has_start = true;
1054 * Sets the value of field 'viewreference'.
1056 * @param viewreference
1057 * the value of field 'viewreference'.
1059 public void setViewreference(final boolean viewreference)
1061 this._viewreference = viewreference;
1062 this._has_viewreference = true;
1069 * @throws org.exolab.castor.xml.MarshalException
1070 * if object is null or if any SAXException is thrown during
1072 * @throws org.exolab.castor.xml.ValidationException
1073 * if this object is an invalid instance according to the schema
1074 * @return the unmarshaled jalview.schemabinding.version2.JSeq
1076 public static jalview.schemabinding.version2.JSeq unmarshal(
1077 final java.io.Reader reader)
1078 throws org.exolab.castor.xml.MarshalException,
1079 org.exolab.castor.xml.ValidationException
1081 return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(
1082 jalview.schemabinding.version2.JSeq.class, reader);
1088 * @throws org.exolab.castor.xml.ValidationException
1089 * if this object is an invalid instance according to the schema
1091 public void validate() throws org.exolab.castor.xml.ValidationException
1093 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1094 validator.validate(this);