9e68130dd830c4da523440a88500aae594d600ea
[jalview.git] / src / jalview / binding / Residue.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 Residue.\r
45  *\r
46  * @version $Revision$ $Date$\r
47  */\r
48 public class Residue implements java.io.Serializable {\r
49 \r
50 \r
51       //--------------------------/\r
52      //- Class/Member Variables -/\r
53     //--------------------------/\r
54 \r
55     /**\r
56      * Field _name\r
57      */\r
58     private java.lang.String _name;\r
59 \r
60     /**\r
61      * Field _RGB\r
62      */\r
63     private int _RGB;\r
64 \r
65     /**\r
66      * keeps track of state for field: _RGB\r
67      */\r
68     private boolean _has_RGB;\r
69 \r
70 \r
71       //----------------/\r
72      //- Constructors -/\r
73     //----------------/\r
74 \r
75     public Residue() {\r
76         super();\r
77     } //-- jalview.binding.Residue()\r
78 \r
79 \r
80       //-----------/\r
81      //- Methods -/\r
82     //-----------/\r
83 \r
84     /**\r
85      * Method deleteRGB\r
86      *\r
87      */\r
88     public void deleteRGB()\r
89     {\r
90         this._has_RGB= false;\r
91     } //-- void deleteRGB()\r
92 \r
93     /**\r
94      * Returns the value of field 'name'.\r
95      *\r
96      * @return String\r
97      * @return the value of field 'name'.\r
98      */\r
99     public java.lang.String getName()\r
100     {\r
101         return this._name;\r
102     } //-- java.lang.String getName()\r
103 \r
104     /**\r
105      * Returns the value of field 'RGB'.\r
106      *\r
107      * @return int\r
108      * @return the value of field 'RGB'.\r
109      */\r
110     public int getRGB()\r
111     {\r
112         return this._RGB;\r
113     } //-- int getRGB()\r
114 \r
115     /**\r
116      * Method hasRGB\r
117      *\r
118      *\r
119      *\r
120      * @return boolean\r
121      */\r
122     public boolean hasRGB()\r
123     {\r
124         return this._has_RGB;\r
125     } //-- boolean hasRGB()\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 'name'.\r
175      *\r
176      * @param name the value of field 'name'.\r
177      */\r
178     public void setName(java.lang.String name)\r
179     {\r
180         this._name = name;\r
181     } //-- void setName(java.lang.String)\r
182 \r
183     /**\r
184      * Sets the value of field 'RGB'.\r
185      *\r
186      * @param RGB the value of field 'RGB'.\r
187      */\r
188     public void setRGB(int RGB)\r
189     {\r
190         this._RGB = RGB;\r
191         this._has_RGB = true;\r
192     } //-- void setRGB(int)\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.Residue) Unmarshaller.unmarshal(jalview.binding.Residue.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