2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
\r
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
\r
5 * This file is part of Jalview.
\r
7 * Jalview is free software: you can redistribute it and/or
\r
8 * modify it under the terms of the GNU General Public License
\r
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
\r
11 * Jalview is distributed in the hope that it will be useful, but
\r
12 * WITHOUT ANY WARRANTY; without even the implied warranty
\r
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
14 * PURPOSE. See the GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
\r
18 package jalview.schemabinding.version2;
\r
20 //---------------------------------/
\r
21 //- Imported classes and packages -/
\r
22 //---------------------------------/
\r
24 import org.exolab.castor.xml.Marshaller;
\r
25 import org.exolab.castor.xml.Unmarshaller;
\r
28 * a region from start to end inclusive
\r
30 * @version $Revision$ $Date$
\r
32 public class MapListFrom implements java.io.Serializable
\r
35 // --------------------------/
\r
36 // - Class/Member Variables -/
\r
37 // --------------------------/
\r
45 * keeps track of state for field: _start
\r
47 private boolean _has_start;
\r
55 * keeps track of state for field: _end
\r
57 private boolean _has_end;
\r
59 // ----------------/
\r
60 // - Constructors -/
\r
61 // ----------------/
\r
63 public MapListFrom()
\r
74 public void deleteEnd()
\r
76 this._has_end = false;
\r
81 public void deleteStart()
\r
83 this._has_start = false;
\r
87 * Returns the value of field 'end'.
\r
89 * @return the value of field 'End'.
\r
97 * Returns the value of field 'start'.
\r
99 * @return the value of field 'Start'.
\r
101 public int getStart()
\r
103 return this._start;
\r
109 * @return true if at least one End has been added
\r
111 public boolean hasEnd()
\r
113 return this._has_end;
\r
119 * @return true if at least one Start has been added
\r
121 public boolean hasStart()
\r
123 return this._has_start;
\r
129 * @return true if this object is valid according to the schema
\r
131 public boolean isValid()
\r
136 } catch (org.exolab.castor.xml.ValidationException vex)
\r
147 * @throws org.exolab.castor.xml.MarshalException
\r
148 * if object is null or if any SAXException is thrown during
\r
150 * @throws org.exolab.castor.xml.ValidationException
\r
151 * if this object is an invalid instance according to the schema
\r
153 public void marshal(final java.io.Writer out)
\r
154 throws org.exolab.castor.xml.MarshalException,
\r
155 org.exolab.castor.xml.ValidationException
\r
157 Marshaller.marshal(this, out);
\r
164 * @throws java.io.IOException
\r
165 * if an IOException occurs during marshaling
\r
166 * @throws org.exolab.castor.xml.ValidationException
\r
167 * if this object is an invalid instance according to the schema
\r
168 * @throws org.exolab.castor.xml.MarshalException
\r
169 * if object is null or if any SAXException is thrown during
\r
172 public void marshal(final org.xml.sax.ContentHandler handler)
\r
173 throws java.io.IOException,
\r
174 org.exolab.castor.xml.MarshalException,
\r
175 org.exolab.castor.xml.ValidationException
\r
177 Marshaller.marshal(this, handler);
\r
181 * Sets the value of field 'end'.
\r
184 * the value of field 'end'.
\r
186 public void setEnd(final int end)
\r
189 this._has_end = true;
\r
193 * Sets the value of field 'start'.
\r
196 * the value of field 'start'.
\r
198 public void setStart(final int start)
\r
200 this._start = start;
\r
201 this._has_start = true;
\r
205 * Method unmarshal.
\r
208 * @throws org.exolab.castor.xml.MarshalException
\r
209 * if object is null or if any SAXException is thrown during
\r
211 * @throws org.exolab.castor.xml.ValidationException
\r
212 * if this object is an invalid instance according to the schema
\r
213 * @return the unmarshaled jalview.schemabinding.version2.MapListFrom
\r
215 public static jalview.schemabinding.version2.MapListFrom unmarshal(
\r
216 final java.io.Reader reader)
\r
217 throws org.exolab.castor.xml.MarshalException,
\r
218 org.exolab.castor.xml.ValidationException
\r
220 return (jalview.schemabinding.version2.MapListFrom) Unmarshaller
\r
221 .unmarshal(jalview.schemabinding.version2.MapListFrom.class,
\r
228 * @throws org.exolab.castor.xml.ValidationException
\r
229 * if this object is an invalid instance according to the schema
\r
231 public void validate() throws org.exolab.castor.xml.ValidationException
\r
233 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
234 validator.validate(this);
\r