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 * This is annotation over the coordinate frame
\r
19 * defined by all the columns in the alignment.
\r
22 * @version $Revision$ $Date$
\r
24 public class AlignmentAnnotation extends uk.ac.vamsas.objects.core.RangeAnnotation
\r
25 implements java.io.Serializable
\r
29 //--------------------------/
\r
30 //- Class/Member Variables -/
\r
31 //--------------------------/
\r
34 * TODO: decide if this flag is
\r
35 * redundant - when true it would suggest that
\r
36 * the annotationElement values together form a
\r
39 private boolean _graph;
\r
42 * keeps track of state for field: _graph
\r
44 private boolean _has_graph;
\r
47 * Field _provenance.
\r
49 private uk.ac.vamsas.objects.core.Provenance _provenance;
\r
56 public AlignmentAnnotation() {
\r
67 public void deleteGraph(
\r
69 this._has_graph= false;
\r
73 * Overrides the java.lang.Object.equals method.
\r
76 * @return true if the objects are equal.
\r
78 public boolean equals(
\r
79 final java.lang.Object obj) {
\r
83 if (super.equals(obj)==false)
\r
86 if (obj instanceof AlignmentAnnotation) {
\r
88 AlignmentAnnotation temp = (AlignmentAnnotation)obj;
\r
89 if (this._graph != temp._graph)
\r
91 if (this._has_graph != temp._has_graph)
\r
93 if (this._provenance != null) {
\r
94 if (temp._provenance == null) return false;
\r
95 else if (!(this._provenance.equals(temp._provenance)))
\r
98 else if (temp._provenance != null)
\r
106 * Returns the value of field 'graph'. The field 'graph' has
\r
107 * the following description: TODO: decide if this flag is
\r
108 * redundant - when true it would suggest that
\r
109 * the annotationElement values together form a
\r
112 * @return the value of field 'Graph'.
\r
114 public boolean getGraph(
\r
116 return this._graph;
\r
120 * Returns the value of field 'provenance'.
\r
122 * @return the value of field 'Provenance'.
\r
124 public uk.ac.vamsas.objects.core.Provenance getProvenance(
\r
126 return this._provenance;
\r
132 * @return true if at least one Graph has been added
\r
134 public boolean hasGraph(
\r
136 return this._has_graph;
\r
140 * Overrides the java.lang.Object.hashCode method.
\r
142 * The following steps came from <b>Effective Java Programming
\r
143 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
145 * @return a hash code value for the object.
\r
147 public int hashCode(
\r
149 int result = super.hashCode();
\r
152 result = 37 * result + (_graph?0:1);
\r
153 if (_provenance != null) {
\r
154 result = 37 * result + _provenance.hashCode();
\r
161 * Returns the value of field 'graph'. The field 'graph' has
\r
162 * the following description: TODO: decide if this flag is
\r
163 * redundant - when true it would suggest that
\r
164 * the annotationElement values together form a
\r
167 * @return the value of field 'Graph'.
\r
169 public boolean isGraph(
\r
171 return this._graph;
\r
177 * @return true if this object is valid according to the schema
\r
179 public boolean isValid(
\r
183 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
193 * @throws org.exolab.castor.xml.MarshalException if object is
\r
194 * null or if any SAXException is thrown during marshaling
\r
195 * @throws org.exolab.castor.xml.ValidationException if this
\r
196 * object is an invalid instance according to the schema
\r
198 public void marshal(
\r
199 final java.io.Writer out)
\r
200 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
201 Marshaller.marshal(this, out);
\r
208 * @throws java.io.IOException if an IOException occurs during
\r
210 * @throws org.exolab.castor.xml.ValidationException if this
\r
211 * object is an invalid instance according to the schema
\r
212 * @throws org.exolab.castor.xml.MarshalException if object is
\r
213 * null or if any SAXException is thrown during marshaling
\r
215 public void marshal(
\r
216 final org.xml.sax.ContentHandler handler)
\r
217 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
218 Marshaller.marshal(this, handler);
\r
222 * Sets the value of field 'graph'. The field 'graph' has the
\r
223 * following description: TODO: decide if this flag is
\r
224 * redundant - when true it would suggest that
\r
225 * the annotationElement values together form a
\r
228 * @param graph the value of field 'graph'.
\r
230 public void setGraph(
\r
231 final boolean graph) {
\r
232 this._graph = graph;
\r
233 this._has_graph = true;
\r
237 * Sets the value of field 'provenance'.
\r
239 * @param provenance the value of field 'provenance'.
\r
241 public void setProvenance(
\r
242 final uk.ac.vamsas.objects.core.Provenance provenance) {
\r
243 this._provenance = provenance;
\r
247 * Method unmarshal.
\r
250 * @throws org.exolab.castor.xml.MarshalException if object is
\r
251 * null or if any SAXException is thrown during marshaling
\r
252 * @throws org.exolab.castor.xml.ValidationException if this
\r
253 * object is an invalid instance according to the schema
\r
254 * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
\r
256 public static uk.ac.vamsas.objects.core.RangeType unmarshal(
\r
257 final java.io.Reader reader)
\r
258 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
259 return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentAnnotation.class, reader);
\r
265 * @throws org.exolab.castor.xml.ValidationException if this
\r
266 * object is an invalid instance according to the schema
\r
268 public void validate(
\r
270 throws org.exolab.castor.xml.ValidationException {
\r
271 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
272 validator.validate(this);
\r