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