2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.binding;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
18 * Class JalviewModelSequence.
20 * @version $Revision$ $Date$
22 public class JalviewModelSequence implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
32 private java.util.Vector _JSeqList;
37 private java.util.Vector _JGroupList;
40 * Field _viewportList.
42 private java.util.Vector _viewportList;
45 * Field _userColoursList.
47 private java.util.Vector _userColoursList;
52 private java.util.Vector _treeList;
55 * Field _featureSettings.
57 private jalview.binding.FeatureSettings _featureSettings;
63 public JalviewModelSequence()
66 this._JSeqList = new java.util.Vector();
67 this._JGroupList = new java.util.Vector();
68 this._viewportList = new java.util.Vector();
69 this._userColoursList = new java.util.Vector();
70 this._treeList = new java.util.Vector();
81 * @throws java.lang.IndexOutOfBoundsException
82 * if the index given is outside the bounds of the collection
84 public void addJGroup(final jalview.binding.JGroup vJGroup)
85 throws java.lang.IndexOutOfBoundsException
87 this._JGroupList.addElement(vJGroup);
95 * @throws java.lang.IndexOutOfBoundsException
96 * if the index given is outside the bounds of the collection
98 public void addJGroup(final int index,
99 final jalview.binding.JGroup vJGroup)
100 throws java.lang.IndexOutOfBoundsException
102 this._JGroupList.add(index, vJGroup);
109 * @throws java.lang.IndexOutOfBoundsException
110 * if the index given is outside the bounds of the collection
112 public void addJSeq(final jalview.binding.JSeq vJSeq)
113 throws java.lang.IndexOutOfBoundsException
115 this._JSeqList.addElement(vJSeq);
123 * @throws java.lang.IndexOutOfBoundsException
124 * if the index given is outside the bounds of the collection
126 public void addJSeq(final int index, final jalview.binding.JSeq vJSeq)
127 throws java.lang.IndexOutOfBoundsException
129 this._JSeqList.add(index, vJSeq);
136 * @throws java.lang.IndexOutOfBoundsException
137 * if the index given is outside the bounds of the collection
139 public void addTree(final jalview.binding.Tree vTree)
140 throws java.lang.IndexOutOfBoundsException
142 this._treeList.addElement(vTree);
150 * @throws java.lang.IndexOutOfBoundsException
151 * if the index given is outside the bounds of the collection
153 public void addTree(final int index, final jalview.binding.Tree vTree)
154 throws java.lang.IndexOutOfBoundsException
156 this._treeList.add(index, vTree);
162 * @param vUserColours
163 * @throws java.lang.IndexOutOfBoundsException
164 * if the index given is outside the bounds of the collection
166 public void addUserColours(final jalview.binding.UserColours vUserColours)
167 throws java.lang.IndexOutOfBoundsException
169 this._userColoursList.addElement(vUserColours);
176 * @param vUserColours
177 * @throws java.lang.IndexOutOfBoundsException
178 * if the index given is outside the bounds of the collection
180 public void addUserColours(final int index,
181 final jalview.binding.UserColours vUserColours)
182 throws java.lang.IndexOutOfBoundsException
184 this._userColoursList.add(index, vUserColours);
191 * @throws java.lang.IndexOutOfBoundsException
192 * if the index given is outside the bounds of the collection
194 public void addViewport(final jalview.binding.Viewport vViewport)
195 throws java.lang.IndexOutOfBoundsException
197 this._viewportList.addElement(vViewport);
205 * @throws java.lang.IndexOutOfBoundsException
206 * if the index given is outside the bounds of the collection
208 public void addViewport(final int index,
209 final jalview.binding.Viewport vViewport)
210 throws java.lang.IndexOutOfBoundsException
212 this._viewportList.add(index, vViewport);
216 * Method enumerateJGroup.
218 * @return an Enumeration over all jalview.binding.JGroup elements
220 public java.util.Enumeration enumerateJGroup()
222 return this._JGroupList.elements();
226 * Method enumerateJSeq.
228 * @return an Enumeration over all jalview.binding.JSeq elements
230 public java.util.Enumeration enumerateJSeq()
232 return this._JSeqList.elements();
236 * Method enumerateTree.
238 * @return an Enumeration over all jalview.binding.Tree elements
240 public java.util.Enumeration enumerateTree()
242 return this._treeList.elements();
246 * Method enumerateUserColours.
248 * @return an Enumeration over all jalview.binding.UserColours elements
250 public java.util.Enumeration enumerateUserColours()
252 return this._userColoursList.elements();
256 * Method enumerateViewport.
258 * @return an Enumeration over all jalview.binding.Viewport elements
260 public java.util.Enumeration enumerateViewport()
262 return this._viewportList.elements();
266 * Returns the value of field 'featureSettings'.
268 * @return the value of field 'FeatureSettings'.
270 public jalview.binding.FeatureSettings getFeatureSettings()
272 return this._featureSettings;
279 * @throws java.lang.IndexOutOfBoundsException
280 * if the index given is outside the bounds of the collection
281 * @return the value of the jalview.binding.JGroup at the given index
283 public jalview.binding.JGroup getJGroup(final int index)
284 throws java.lang.IndexOutOfBoundsException
286 // check bounds for index
287 if (index < 0 || index >= this._JGroupList.size())
289 throw new IndexOutOfBoundsException("getJGroup: Index value '"
290 + index + "' not in range [0.."
291 + (this._JGroupList.size() - 1) + "]");
294 return (jalview.binding.JGroup) _JGroupList.get(index);
298 * Method getJGroup.Returns the contents of the collection in an Array.
300 * Note: Just in case the collection contents are changing in another thread,
301 * we pass a 0-length Array of the correct type into the API call. This way we
302 * <i>know</i> that the Array returned is of exactly the correct length.
304 * @return this collection as an Array
306 public jalview.binding.JGroup[] getJGroup()
308 jalview.binding.JGroup[] array = new jalview.binding.JGroup[0];
309 return (jalview.binding.JGroup[]) this._JGroupList.toArray(array);
313 * Method getJGroupCount.
315 * @return the size of this collection
317 public int getJGroupCount()
319 return this._JGroupList.size();
326 * @throws java.lang.IndexOutOfBoundsException
327 * if the index given is outside the bounds of the collection
328 * @return the value of the jalview.binding.JSeq at the given index
330 public jalview.binding.JSeq getJSeq(final int index)
331 throws java.lang.IndexOutOfBoundsException
333 // check bounds for index
334 if (index < 0 || index >= this._JSeqList.size())
336 throw new IndexOutOfBoundsException("getJSeq: Index value '" + index
337 + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
340 return (jalview.binding.JSeq) _JSeqList.get(index);
344 * Method getJSeq.Returns the contents of the collection in an Array.
346 * Note: Just in case the collection contents are changing in another thread,
347 * we pass a 0-length Array of the correct type into the API call. This way we
348 * <i>know</i> that the Array returned is of exactly the correct length.
350 * @return this collection as an Array
352 public jalview.binding.JSeq[] getJSeq()
354 jalview.binding.JSeq[] array = new jalview.binding.JSeq[0];
355 return (jalview.binding.JSeq[]) this._JSeqList.toArray(array);
359 * Method getJSeqCount.
361 * @return the size of this collection
363 public int getJSeqCount()
365 return this._JSeqList.size();
372 * @throws java.lang.IndexOutOfBoundsException
373 * if the index given is outside the bounds of the collection
374 * @return the value of the jalview.binding.Tree at the given index
376 public jalview.binding.Tree getTree(final int index)
377 throws java.lang.IndexOutOfBoundsException
379 // check bounds for index
380 if (index < 0 || index >= this._treeList.size())
382 throw new IndexOutOfBoundsException("getTree: Index value '" + index
383 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
386 return (jalview.binding.Tree) _treeList.get(index);
390 * Method getTree.Returns the contents of the collection in an Array.
392 * Note: Just in case the collection contents are changing in another thread,
393 * we pass a 0-length Array of the correct type into the API call. This way we
394 * <i>know</i> that the Array returned is of exactly the correct length.
396 * @return this collection as an Array
398 public jalview.binding.Tree[] getTree()
400 jalview.binding.Tree[] array = new jalview.binding.Tree[0];
401 return (jalview.binding.Tree[]) this._treeList.toArray(array);
405 * Method getTreeCount.
407 * @return the size of this collection
409 public int getTreeCount()
411 return this._treeList.size();
415 * Method getUserColours.
418 * @throws java.lang.IndexOutOfBoundsException
419 * if the index given is outside the bounds of the collection
420 * @return the value of the jalview.binding.UserColours at the given index
422 public jalview.binding.UserColours getUserColours(final int index)
423 throws java.lang.IndexOutOfBoundsException
425 // check bounds for index
426 if (index < 0 || index >= this._userColoursList.size())
428 throw new IndexOutOfBoundsException("getUserColours: Index value '"
429 + index + "' not in range [0.."
430 + (this._userColoursList.size() - 1) + "]");
433 return (jalview.binding.UserColours) _userColoursList.get(index);
437 * Method getUserColours.Returns the contents of the collection in an Array.
439 * Note: Just in case the collection contents are changing in another thread,
440 * we pass a 0-length Array of the correct type into the API call. This way we
441 * <i>know</i> that the Array returned is of exactly the correct length.
443 * @return this collection as an Array
445 public jalview.binding.UserColours[] getUserColours()
447 jalview.binding.UserColours[] array = new jalview.binding.UserColours[0];
448 return (jalview.binding.UserColours[]) this._userColoursList
453 * Method getUserColoursCount.
455 * @return the size of this collection
457 public int getUserColoursCount()
459 return this._userColoursList.size();
463 * Method getViewport.
466 * @throws java.lang.IndexOutOfBoundsException
467 * if the index given is outside the bounds of the collection
468 * @return the value of the jalview.binding.Viewport at the given index
470 public jalview.binding.Viewport getViewport(final int index)
471 throws java.lang.IndexOutOfBoundsException
473 // check bounds for index
474 if (index < 0 || index >= this._viewportList.size())
476 throw new IndexOutOfBoundsException("getViewport: Index value '"
477 + index + "' not in range [0.."
478 + (this._viewportList.size() - 1) + "]");
481 return (jalview.binding.Viewport) _viewportList.get(index);
485 * Method getViewport.Returns the contents of the collection in an Array.
487 * Note: Just in case the collection contents are changing in another thread,
488 * we pass a 0-length Array of the correct type into the API call. This way we
489 * <i>know</i> that the Array returned is of exactly the correct length.
491 * @return this collection as an Array
493 public jalview.binding.Viewport[] getViewport()
495 jalview.binding.Viewport[] array = new jalview.binding.Viewport[0];
496 return (jalview.binding.Viewport[]) this._viewportList.toArray(array);
500 * Method getViewportCount.
502 * @return the size of this collection
504 public int getViewportCount()
506 return this._viewportList.size();
512 * @return true if this object is valid according to the schema
514 public boolean isValid()
519 } catch (org.exolab.castor.xml.ValidationException vex)
530 * @throws org.exolab.castor.xml.MarshalException
531 * if object is null or if any SAXException is thrown during
533 * @throws org.exolab.castor.xml.ValidationException
534 * if this object is an invalid instance according to the schema
536 public void marshal(final java.io.Writer out)
537 throws org.exolab.castor.xml.MarshalException,
538 org.exolab.castor.xml.ValidationException
540 Marshaller.marshal(this, out);
547 * @throws java.io.IOException
548 * if an IOException occurs during marshaling
549 * @throws org.exolab.castor.xml.ValidationException
550 * if this object is an invalid instance according to the schema
551 * @throws org.exolab.castor.xml.MarshalException
552 * if object is null or if any SAXException is thrown during
555 public void marshal(final org.xml.sax.ContentHandler handler)
556 throws java.io.IOException,
557 org.exolab.castor.xml.MarshalException,
558 org.exolab.castor.xml.ValidationException
560 Marshaller.marshal(this, handler);
565 public void removeAllJGroup()
567 this._JGroupList.clear();
572 public void removeAllJSeq()
574 this._JSeqList.clear();
579 public void removeAllTree()
581 this._treeList.clear();
586 public void removeAllUserColours()
588 this._userColoursList.clear();
593 public void removeAllViewport()
595 this._viewportList.clear();
599 * Method removeJGroup.
602 * @return true if the object was removed from the collection.
604 public boolean removeJGroup(final jalview.binding.JGroup vJGroup)
606 boolean removed = _JGroupList.remove(vJGroup);
611 * Method removeJGroupAt.
614 * @return the element removed from the collection
616 public jalview.binding.JGroup removeJGroupAt(final int index)
618 java.lang.Object obj = this._JGroupList.remove(index);
619 return (jalview.binding.JGroup) obj;
626 * @return true if the object was removed from the collection.
628 public boolean removeJSeq(final jalview.binding.JSeq vJSeq)
630 boolean removed = _JSeqList.remove(vJSeq);
635 * Method removeJSeqAt.
638 * @return the element removed from the collection
640 public jalview.binding.JSeq removeJSeqAt(final int index)
642 java.lang.Object obj = this._JSeqList.remove(index);
643 return (jalview.binding.JSeq) obj;
650 * @return true if the object was removed from the collection.
652 public boolean removeTree(final jalview.binding.Tree vTree)
654 boolean removed = _treeList.remove(vTree);
659 * Method removeTreeAt.
662 * @return the element removed from the collection
664 public jalview.binding.Tree removeTreeAt(final int index)
666 java.lang.Object obj = this._treeList.remove(index);
667 return (jalview.binding.Tree) obj;
671 * Method removeUserColours.
673 * @param vUserColours
674 * @return true if the object was removed from the collection.
676 public boolean removeUserColours(
677 final jalview.binding.UserColours vUserColours)
679 boolean removed = _userColoursList.remove(vUserColours);
684 * Method removeUserColoursAt.
687 * @return the element removed from the collection
689 public jalview.binding.UserColours removeUserColoursAt(final int index)
691 java.lang.Object obj = this._userColoursList.remove(index);
692 return (jalview.binding.UserColours) obj;
696 * Method removeViewport.
699 * @return true if the object was removed from the collection.
701 public boolean removeViewport(final jalview.binding.Viewport vViewport)
703 boolean removed = _viewportList.remove(vViewport);
708 * Method removeViewportAt.
711 * @return the element removed from the collection
713 public jalview.binding.Viewport removeViewportAt(final int index)
715 java.lang.Object obj = this._viewportList.remove(index);
716 return (jalview.binding.Viewport) obj;
720 * Sets the value of field 'featureSettings'.
722 * @param featureSettings
723 * the value of field 'featureSettings'.
725 public void setFeatureSettings(
726 final jalview.binding.FeatureSettings featureSettings)
728 this._featureSettings = featureSettings;
736 * @throws java.lang.IndexOutOfBoundsException
737 * if the index given is outside the bounds of the collection
739 public void setJGroup(final int index,
740 final jalview.binding.JGroup vJGroup)
741 throws java.lang.IndexOutOfBoundsException
743 // check bounds for index
744 if (index < 0 || index >= this._JGroupList.size())
746 throw new IndexOutOfBoundsException("setJGroup: Index value '"
747 + index + "' not in range [0.."
748 + (this._JGroupList.size() - 1) + "]");
751 this._JGroupList.set(index, vJGroup);
757 * @param vJGroupArray
759 public void setJGroup(final jalview.binding.JGroup[] vJGroupArray)
764 for (int i = 0; i < vJGroupArray.length; i++)
766 this._JGroupList.add(vJGroupArray[i]);
775 * @throws java.lang.IndexOutOfBoundsException
776 * if the index given is outside the bounds of the collection
778 public void setJSeq(final int index, final jalview.binding.JSeq vJSeq)
779 throws java.lang.IndexOutOfBoundsException
781 // check bounds for index
782 if (index < 0 || index >= this._JSeqList.size())
784 throw new IndexOutOfBoundsException("setJSeq: Index value '" + index
785 + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
788 this._JSeqList.set(index, vJSeq);
796 public void setJSeq(final jalview.binding.JSeq[] vJSeqArray)
801 for (int i = 0; i < vJSeqArray.length; i++)
803 this._JSeqList.add(vJSeqArray[i]);
812 * @throws java.lang.IndexOutOfBoundsException
813 * if the index given is outside the bounds of the collection
815 public void setTree(final int index, final jalview.binding.Tree vTree)
816 throws java.lang.IndexOutOfBoundsException
818 // check bounds for index
819 if (index < 0 || index >= this._treeList.size())
821 throw new IndexOutOfBoundsException("setTree: Index value '" + index
822 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
825 this._treeList.set(index, vTree);
833 public void setTree(final jalview.binding.Tree[] vTreeArray)
838 for (int i = 0; i < vTreeArray.length; i++)
840 this._treeList.add(vTreeArray[i]);
848 * @param vUserColours
849 * @throws java.lang.IndexOutOfBoundsException
850 * if the index given is outside the bounds of the collection
852 public void setUserColours(final int index,
853 final jalview.binding.UserColours vUserColours)
854 throws java.lang.IndexOutOfBoundsException
856 // check bounds for index
857 if (index < 0 || index >= this._userColoursList.size())
859 throw new IndexOutOfBoundsException("setUserColours: Index value '"
860 + index + "' not in range [0.."
861 + (this._userColoursList.size() - 1) + "]");
864 this._userColoursList.set(index, vUserColours);
870 * @param vUserColoursArray
872 public void setUserColours(
873 final jalview.binding.UserColours[] vUserColoursArray)
876 _userColoursList.clear();
878 for (int i = 0; i < vUserColoursArray.length; i++)
880 this._userColoursList.add(vUserColoursArray[i]);
889 * @throws java.lang.IndexOutOfBoundsException
890 * if the index given is outside the bounds of the collection
892 public void setViewport(final int index,
893 final jalview.binding.Viewport vViewport)
894 throws java.lang.IndexOutOfBoundsException
896 // check bounds for index
897 if (index < 0 || index >= this._viewportList.size())
899 throw new IndexOutOfBoundsException("setViewport: Index value '"
900 + index + "' not in range [0.."
901 + (this._viewportList.size() - 1) + "]");
904 this._viewportList.set(index, vViewport);
910 * @param vViewportArray
912 public void setViewport(final jalview.binding.Viewport[] vViewportArray)
915 _viewportList.clear();
917 for (int i = 0; i < vViewportArray.length; i++)
919 this._viewportList.add(vViewportArray[i]);
927 * @throws org.exolab.castor.xml.MarshalException
928 * if object is null or if any SAXException is thrown during
930 * @throws org.exolab.castor.xml.ValidationException
931 * if this object is an invalid instance according to the schema
932 * @return the unmarshaled jalview.binding.JalviewModelSequence
934 public static jalview.binding.JalviewModelSequence unmarshal(
935 final java.io.Reader reader)
936 throws org.exolab.castor.xml.MarshalException,
937 org.exolab.castor.xml.ValidationException
939 return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(
940 jalview.binding.JalviewModelSequence.class, reader);
946 * @throws org.exolab.castor.xml.ValidationException
947 * if this object is an invalid instance according to the schema
949 public void validate() throws org.exolab.castor.xml.ValidationException
951 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
952 validator.validate(this);