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