Formatted source
[jalview.git] / src / jalview / binding / UserColour.java
1 /*\r
2  * This class was automatically generated with\r
3  * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 /*\r
8 * Jalview - A Sequence Alignment Editor and Viewer\r
9 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
10 *\r
11 * This program is free software; you can redistribute it and/or\r
12 * modify it under the terms of the GNU General Public License\r
13 * as published by the Free Software Foundation; either version 2\r
14 * of the License, or (at your option) any later version.\r
15 *\r
16 * This program is distributed in the hope that it will be useful,\r
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
19 * GNU General Public License for more details.\r
20 *\r
21 * You should have received a copy of the GNU General Public License\r
22 * along with this program; if not, write to the Free Software\r
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
24 */\r
25 package jalview.binding;\r
26 \r
27 import org.exolab.castor.xml.MarshalException;\r
28 import org.exolab.castor.xml.Marshaller;\r
29 import org.exolab.castor.xml.Unmarshaller;\r
30 import org.exolab.castor.xml.ValidationException;\r
31 \r
32 import org.xml.sax.ContentHandler;\r
33 \r
34 //---------------------------------/\r
35 //- Imported classes and packages -/\r
36 //---------------------------------/\r
37 import java.io.IOException;\r
38 import java.io.Reader;\r
39 import java.io.Serializable;\r
40 import java.io.Writer;\r
41 \r
42 \r
43 /**\r
44  * Class UserColour.\r
45  *\r
46  * @version $Revision$ $Date$\r
47  */\r
48 public class UserColour implements java.io.Serializable {\r
49     //--------------------------/\r
50     //- Class/Member Variables -/\r
51     //--------------------------/\r
52 \r
53     /**\r
54      * Field _id\r
55      */\r
56     private int _id;\r
57 \r
58     /**\r
59      * keeps track of state for field: _id\r
60      */\r
61     private boolean _has_id;\r
62 \r
63     /**\r
64      * Field _userColourScheme\r
65      */\r
66     private jalview.binding.UserColourScheme _userColourScheme;\r
67 \r
68     //----------------/\r
69     //- Constructors -/\r
70     //----------------/\r
71     public UserColour() {\r
72         super();\r
73     }\r
74      //-- jalview.binding.UserColour()\r
75  //-----------/\r
76 \r
77     public void deleteId() {\r
78         this._has_id = false;\r
79     }\r
80      //-- void deleteId()\r
81 \r
82     /**\r
83      * Returns the value of field 'id'.\r
84      *\r
85      * @return int\r
86      * @return the value of field 'id'.\r
87      */\r
88     public int getId() {\r
89         return this._id;\r
90     }\r
91      //-- int getId()\r
92 \r
93     /**\r
94      * Returns the value of field 'userColourScheme'.\r
95      *\r
96      * @return UserColourScheme\r
97      * @return the value of field 'userColourScheme'.\r
98      */\r
99     public jalview.binding.UserColourScheme getUserColourScheme() {\r
100         return this._userColourScheme;\r
101     }\r
102      //-- jalview.binding.UserColourScheme getUserColourScheme()\r
103 \r
104     /**\r
105      * Method hasId\r
106      *\r
107      *\r
108      *\r
109      * @return boolean\r
110      */\r
111     public boolean hasId() {\r
112         return this._has_id;\r
113     }\r
114      //-- boolean hasId()\r
115 \r
116     /**\r
117      * Method isValid\r
118      *\r
119      *\r
120      *\r
121      * @return boolean\r
122      */\r
123     public boolean isValid() {\r
124         try {\r
125             validate();\r
126         } catch (org.exolab.castor.xml.ValidationException vex) {\r
127             return false;\r
128         }\r
129 \r
130         return true;\r
131     }\r
132      //-- boolean isValid()\r
133 \r
134     /**\r
135      * Method marshal\r
136      *\r
137      *\r
138      *\r
139      * @param out\r
140      */\r
141     public void marshal(java.io.Writer out)\r
142         throws org.exolab.castor.xml.MarshalException, \r
143             org.exolab.castor.xml.ValidationException {\r
144         Marshaller.marshal(this, out);\r
145     }\r
146      //-- void marshal(java.io.Writer)\r
147 \r
148     /**\r
149      * Method marshal\r
150      *\r
151      *\r
152      *\r
153      * @param handler\r
154      */\r
155     public void marshal(org.xml.sax.ContentHandler handler)\r
156         throws java.io.IOException, org.exolab.castor.xml.MarshalException, \r
157             org.exolab.castor.xml.ValidationException {\r
158         Marshaller.marshal(this, handler);\r
159     }\r
160      //-- void marshal(org.xml.sax.ContentHandler)\r
161 \r
162     /**\r
163      * Sets the value of field 'id'.\r
164      *\r
165      * @param id the value of field 'id'.\r
166      */\r
167     public void setId(int id) {\r
168         this._id = id;\r
169         this._has_id = true;\r
170     }\r
171      //-- void setId(int)\r
172 \r
173     /**\r
174      * Sets the value of field 'userColourScheme'.\r
175      *\r
176      * @param userColourScheme the value of field 'userColourScheme'\r
177      */\r
178     public void setUserColourScheme(\r
179         jalview.binding.UserColourScheme userColourScheme) {\r
180         this._userColourScheme = userColourScheme;\r
181     }\r
182      //-- void setUserColourScheme(jalview.binding.UserColourScheme)\r
183 \r
184     /**\r
185      * Method unmarshal\r
186      *\r
187      *\r
188      *\r
189      * @param reader\r
190      * @return Object\r
191      */\r
192     public static java.lang.Object unmarshal(java.io.Reader reader)\r
193         throws org.exolab.castor.xml.MarshalException, \r
194             org.exolab.castor.xml.ValidationException {\r
195         return (jalview.binding.UserColour) Unmarshaller.unmarshal(jalview.binding.UserColour.class,\r
196             reader);\r
197     }\r
198      //-- java.lang.Object unmarshal(java.io.Reader)\r
199 \r
200     /**\r
201      * Method validate\r
202      *\r
203      */\r
204     public void validate() throws org.exolab.castor.xml.ValidationException {\r
205         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
206         validator.validate(this);\r
207     }\r
208      //-- void validate()\r
209 }\r