2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
16 import org.exolab.castor.xml.*;
\r
19 * Class JalviewUserColours.
\r
21 * @version $Revision$ $Date$
\r
23 public class JalviewUserColours
\r
24 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
34 private java.lang.String _schemeName;
\r
39 private java.util.Vector _colourList;
\r
45 public JalviewUserColours()
\r
48 _colourList = new Vector();
\r
49 } //-- jalview.schemabinding.version2.JalviewUserColours()
\r
62 public void addColour(jalview.schemabinding.version2.Colour vColour)
\r
63 throws java.lang.IndexOutOfBoundsException
\r
65 _colourList.addElement(vColour);
\r
66 } //-- void addColour(jalview.schemabinding.version2.Colour)
\r
76 public void addColour(int index,
\r
77 jalview.schemabinding.version2.Colour vColour)
\r
78 throws java.lang.IndexOutOfBoundsException
\r
80 _colourList.insertElementAt(vColour, index);
\r
81 } //-- void addColour(int, jalview.schemabinding.version2.Colour)
\r
84 * Method enumerateColour
\r
88 * @return Enumeration
\r
90 public java.util.Enumeration enumerateColour()
\r
92 return _colourList.elements();
\r
93 } //-- java.util.Enumeration enumerateColour()
\r
103 public jalview.schemabinding.version2.Colour getColour(int index)
\r
104 throws java.lang.IndexOutOfBoundsException
\r
106 //-- check bounds for index
\r
107 if ( (index < 0) || (index > _colourList.size()))
\r
109 throw new IndexOutOfBoundsException();
\r
112 return (jalview.schemabinding.version2.Colour) _colourList.elementAt(index);
\r
113 } //-- jalview.schemabinding.version2.Colour getColour(int)
\r
122 public jalview.schemabinding.version2.Colour[] getColour()
\r
124 int size = _colourList.size();
\r
125 jalview.schemabinding.version2.Colour[] mArray = new jalview.schemabinding.
\r
126 version2.Colour[size];
\r
127 for (int index = 0; index < size; index++)
\r
129 mArray[index] = (jalview.schemabinding.version2.Colour) _colourList.
\r
133 } //-- jalview.schemabinding.version2.Colour[] getColour()
\r
136 * Method getColourCount
\r
142 public int getColourCount()
\r
144 return _colourList.size();
\r
145 } //-- int getColourCount()
\r
148 * Returns the value of field 'schemeName'.
\r
151 * @return the value of field 'schemeName'.
\r
153 public java.lang.String getSchemeName()
\r
155 return this._schemeName;
\r
156 } //-- java.lang.String getSchemeName()
\r
165 public boolean isValid()
\r
171 catch (org.exolab.castor.xml.ValidationException vex)
\r
176 } //-- boolean isValid()
\r
185 public void marshal(java.io.Writer out)
\r
186 throws org.exolab.castor.xml.MarshalException,
\r
187 org.exolab.castor.xml.ValidationException
\r
190 Marshaller.marshal(this, out);
\r
191 } //-- void marshal(java.io.Writer)
\r
200 public void marshal(org.xml.sax.ContentHandler handler)
\r
201 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
\r
202 org.exolab.castor.xml.ValidationException
\r
205 Marshaller.marshal(this, handler);
\r
206 } //-- void marshal(org.xml.sax.ContentHandler)
\r
209 * Method removeAllColour
\r
212 public void removeAllColour()
\r
214 _colourList.removeAllElements();
\r
215 } //-- void removeAllColour()
\r
218 * Method removeColour
\r
225 public jalview.schemabinding.version2.Colour removeColour(int index)
\r
227 java.lang.Object obj = _colourList.elementAt(index);
\r
228 _colourList.removeElementAt(index);
\r
229 return (jalview.schemabinding.version2.Colour) obj;
\r
230 } //-- jalview.schemabinding.version2.Colour removeColour(int)
\r
240 public void setColour(int index,
\r
241 jalview.schemabinding.version2.Colour vColour)
\r
242 throws java.lang.IndexOutOfBoundsException
\r
244 //-- check bounds for index
\r
245 if ( (index < 0) || (index > _colourList.size()))
\r
247 throw new IndexOutOfBoundsException();
\r
249 _colourList.setElementAt(vColour, index);
\r
250 } //-- void setColour(int, jalview.schemabinding.version2.Colour)
\r
257 * @param colourArray
\r
259 public void setColour(jalview.schemabinding.version2.Colour[] colourArray)
\r
262 _colourList.removeAllElements();
\r
263 for (int i = 0; i < colourArray.length; i++)
\r
265 _colourList.addElement(colourArray[i]);
\r
267 } //-- void setColour(jalview.schemabinding.version2.Colour)
\r
270 * Sets the value of field 'schemeName'.
\r
272 * @param schemeName the value of field 'schemeName'.
\r
274 public void setSchemeName(java.lang.String schemeName)
\r
276 this._schemeName = schemeName;
\r
277 } //-- void setSchemeName(java.lang.String)
\r
287 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
288 throws org.exolab.castor.xml.MarshalException,
\r
289 org.exolab.castor.xml.ValidationException
\r
291 return (jalview.schemabinding.version2.JalviewUserColours) Unmarshaller.
\r
292 unmarshal(jalview.schemabinding.version2.JalviewUserColours.class,
\r
294 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
300 public void validate()
\r
301 throws org.exolab.castor.xml.ValidationException
\r
303 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.
\r
305 validator.validate(this);
\r
306 } //-- void validate()
\r