2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package uk.ac.vamsas.objects.core;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
18 * Class AlignmentSequenceAnnotation.
\r
20 * @version $Revision$ $Date$
\r
22 public class AlignmentSequenceAnnotation extends uk.ac.vamsas.objects.core.RangeAnnotation
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
33 * decide if this flag is
\r
34 * redundant - when true it
\r
35 * would suggest that the
\r
36 * annotationElement values
\r
37 * together form a graph
\r
40 private boolean _graph;
\r
43 * keeps track of state for field: _graph
\r
45 private boolean _has_graph;
\r
48 * Field _provenance.
\r
50 private uk.ac.vamsas.objects.core.Provenance _provenance;
\r
57 public AlignmentSequenceAnnotation() {
\r
68 public void deleteGraph(
\r
70 this._has_graph= false;
\r
74 * Overrides the java.lang.Object.equals method.
\r
77 * @return true if the objects are equal.
\r
79 public boolean equals(
\r
80 final java.lang.Object obj) {
\r
84 if (super.equals(obj)==false)
\r
87 if (obj instanceof AlignmentSequenceAnnotation) {
\r
89 AlignmentSequenceAnnotation temp = (AlignmentSequenceAnnotation)obj;
\r
90 if (this._graph != temp._graph)
\r
92 if (this._has_graph != temp._has_graph)
\r
94 if (this._provenance != null) {
\r
95 if (temp._provenance == null) return false;
\r
96 else if (!(this._provenance.equals(temp._provenance)))
\r
99 else if (temp._provenance != null)
\r
107 * Returns the value of field 'graph'. The field 'graph' has
\r
108 * the following description: TODO:
\r
109 * decide if this flag is
\r
110 * redundant - when true it
\r
111 * would suggest that the
\r
112 * annotationElement values
\r
113 * together form a graph
\r
116 * @return the value of field 'Graph'.
\r
118 public boolean getGraph(
\r
120 return this._graph;
\r
124 * Returns the value of field 'provenance'.
\r
126 * @return the value of field 'Provenance'.
\r
128 public uk.ac.vamsas.objects.core.Provenance getProvenance(
\r
130 return this._provenance;
\r
136 * @return true if at least one Graph has been added
\r
138 public boolean hasGraph(
\r
140 return this._has_graph;
\r
144 * Overrides the java.lang.Object.hashCode method.
\r
146 * The following steps came from <b>Effective Java Programming
\r
147 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
149 * @return a hash code value for the object.
\r
151 public int hashCode(
\r
153 int result = super.hashCode();
\r
156 result = 37 * result + (_graph?0:1);
\r
157 if (_provenance != null) {
\r
158 result = 37 * result + _provenance.hashCode();
\r
165 * Returns the value of field 'graph'. The field 'graph' has
\r
166 * the following description: TODO:
\r
167 * decide if this flag is
\r
168 * redundant - when true it
\r
169 * would suggest that the
\r
170 * annotationElement values
\r
171 * together form a graph
\r
174 * @return the value of field 'Graph'.
\r
176 public boolean isGraph(
\r
178 return this._graph;
\r
184 * @return true if this object is valid according to the schema
\r
186 public boolean isValid(
\r
190 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
200 * @throws org.exolab.castor.xml.MarshalException if object is
\r
201 * null or if any SAXException is thrown during marshaling
\r
202 * @throws org.exolab.castor.xml.ValidationException if this
\r
203 * object is an invalid instance according to the schema
\r
205 public void marshal(
\r
206 final java.io.Writer out)
\r
207 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
208 Marshaller.marshal(this, out);
\r
215 * @throws java.io.IOException if an IOException occurs during
\r
217 * @throws org.exolab.castor.xml.ValidationException if this
\r
218 * object is an invalid instance according to the schema
\r
219 * @throws org.exolab.castor.xml.MarshalException if object is
\r
220 * null or if any SAXException is thrown during marshaling
\r
222 public void marshal(
\r
223 final org.xml.sax.ContentHandler handler)
\r
224 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
225 Marshaller.marshal(this, handler);
\r
229 * Sets the value of field 'graph'. The field 'graph' has the
\r
230 * following description: TODO:
\r
231 * decide if this flag is
\r
232 * redundant - when true it
\r
233 * would suggest that the
\r
234 * annotationElement values
\r
235 * together form a graph
\r
238 * @param graph the value of field 'graph'.
\r
240 public void setGraph(
\r
241 final boolean graph) {
\r
242 this._graph = graph;
\r
243 this._has_graph = true;
\r
247 * Sets the value of field 'provenance'.
\r
249 * @param provenance the value of field 'provenance'.
\r
251 public void setProvenance(
\r
252 final uk.ac.vamsas.objects.core.Provenance provenance) {
\r
253 this._provenance = provenance;
\r
257 * Method unmarshal.
\r
260 * @throws org.exolab.castor.xml.MarshalException if object is
\r
261 * null or if any SAXException is thrown during marshaling
\r
262 * @throws org.exolab.castor.xml.ValidationException if this
\r
263 * object is an invalid instance according to the schema
\r
264 * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
\r
266 public static uk.ac.vamsas.objects.core.RangeType unmarshal(
\r
267 final java.io.Reader reader)
\r
268 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
269 return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, reader);
\r
275 * @throws org.exolab.castor.xml.ValidationException if this
\r
276 * object is an invalid instance according to the schema
\r
278 public void validate(
\r
280 throws org.exolab.castor.xml.ValidationException {
\r
281 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
282 validator.validate(this);
\r