2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
7 package jalview.binding;
\r
9 import org.exolab.castor.xml.MarshalException;
\r
10 import org.exolab.castor.xml.Marshaller;
\r
11 import org.exolab.castor.xml.Unmarshaller;
\r
12 import org.exolab.castor.xml.ValidationException;
\r
14 import org.xml.sax.ContentHandler;
\r
16 //---------------------------------/
\r
17 //- Imported classes and packages -/
\r
18 //---------------------------------/
\r
19 import java.io.IOException;
\r
20 import java.io.Reader;
\r
21 import java.io.Serializable;
\r
22 import java.io.Writer;
\r
24 import java.util.Enumeration;
\r
25 import java.util.Vector;
\r
29 * Class JalviewUserColours.
\r
31 * @version $Revision$ $Date$
\r
33 public class JalviewUserColours implements java.io.Serializable
\r
35 //--------------------------/
\r
36 //- Class/Member Variables -/
\r
37 //--------------------------/
\r
42 private java.util.Vector _colourList;
\r
47 public JalviewUserColours()
\r
50 _colourList = new Vector();
\r
53 //-- jalview.binding.JalviewUserColours()
\r
59 * @param vColour DOCUMENT ME!
\r
61 * @throws java.lang.IndexOutOfBoundsException DOCUMENT ME!
\r
63 public void addColour(jalview.binding.Colour vColour)
\r
64 throws java.lang.IndexOutOfBoundsException
\r
66 _colourList.addElement(vColour);
\r
69 //-- void addColour(jalview.binding.Colour)
\r
79 public void addColour(int index, jalview.binding.Colour vColour)
\r
80 throws java.lang.IndexOutOfBoundsException
\r
82 _colourList.insertElementAt(vColour, index);
\r
85 //-- void addColour(int, jalview.binding.Colour)
\r
88 * Method enumerateColour
\r
92 * @return Enumeration
\r
94 public java.util.Enumeration enumerateColour()
\r
96 return _colourList.elements();
\r
99 //-- java.util.Enumeration enumerateColour()
\r
109 public jalview.binding.Colour getColour(int index)
\r
110 throws java.lang.IndexOutOfBoundsException
\r
112 //-- check bounds for index
\r
113 if ((index < 0) || (index > _colourList.size()))
\r
115 throw new IndexOutOfBoundsException();
\r
118 return (jalview.binding.Colour) _colourList.elementAt(index);
\r
121 //-- jalview.binding.Colour getColour(int)
\r
130 public jalview.binding.Colour[] getColour()
\r
132 int size = _colourList.size();
\r
133 jalview.binding.Colour[] mArray = new jalview.binding.Colour[size];
\r
135 for (int index = 0; index < size; index++)
\r
137 mArray[index] = (jalview.binding.Colour) _colourList.elementAt(index);
\r
143 //-- jalview.binding.Colour[] getColour()
\r
146 * Method getColourCount
\r
152 public int getColourCount()
\r
154 return _colourList.size();
\r
157 //-- int getColourCount()
\r
166 public boolean isValid()
\r
172 catch (org.exolab.castor.xml.ValidationException vex)
\r
180 //-- boolean isValid()
\r
189 public void marshal(java.io.Writer out)
\r
190 throws org.exolab.castor.xml.MarshalException,
\r
191 org.exolab.castor.xml.ValidationException
\r
193 Marshaller.marshal(this, out);
\r
196 //-- void marshal(java.io.Writer)
\r
205 public void marshal(org.xml.sax.ContentHandler handler)
\r
206 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
\r
207 org.exolab.castor.xml.ValidationException
\r
209 Marshaller.marshal(this, handler);
\r
212 //-- void marshal(org.xml.sax.ContentHandler)
\r
215 * Method removeAllColour
\r
218 public void removeAllColour()
\r
220 _colourList.removeAllElements();
\r
223 //-- void removeAllColour()
\r
226 * Method removeColour
\r
233 public jalview.binding.Colour removeColour(int index)
\r
235 java.lang.Object obj = _colourList.elementAt(index);
\r
236 _colourList.removeElementAt(index);
\r
238 return (jalview.binding.Colour) obj;
\r
241 //-- jalview.binding.Colour removeColour(int)
\r
251 public void setColour(int index, jalview.binding.Colour vColour)
\r
252 throws java.lang.IndexOutOfBoundsException
\r
254 //-- check bounds for index
\r
255 if ((index < 0) || (index > _colourList.size()))
\r
257 throw new IndexOutOfBoundsException();
\r
260 _colourList.setElementAt(vColour, index);
\r
263 //-- void setColour(int, jalview.binding.Colour)
\r
270 * @param colourArray
\r
272 public void setColour(jalview.binding.Colour[] colourArray)
\r
275 _colourList.removeAllElements();
\r
277 for (int i = 0; i < colourArray.length; i++)
\r
279 _colourList.addElement(colourArray[i]);
\r
283 //-- void setColour(jalview.binding.Colour)
\r
293 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
294 throws org.exolab.castor.xml.MarshalException,
\r
295 org.exolab.castor.xml.ValidationException
\r
297 return (jalview.binding.JalviewUserColours) Unmarshaller.unmarshal(jalview.binding.JalviewUserColours.class,
\r
301 //-- java.lang.Object unmarshal(java.io.Reader)
\r
307 public void validate() throws org.exolab.castor.xml.ValidationException
\r
309 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
310 validator.validate(this);
\r
313 //-- void validate()
\r