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
92 if (this._graph != temp._graph)
\r
94 if (this._has_graph != temp._has_graph)
\r
96 if (this._provenance != null) {
\r
97 if (temp._provenance == null) return false;
\r
98 if (this._provenance != temp._provenance) {
\r
99 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
\r
100 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
\r
101 if (thcycle!=tmcycle) {
\r
102 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
\r
103 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
\r
107 if (!this._provenance.equals(temp._provenance)) {
\r
108 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
\r
109 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
\r
112 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
\r
113 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
\r
116 } else if (temp._provenance != null)
\r
124 * Returns the value of field 'graph'. The field 'graph' has
\r
125 * the following description: TODO:
\r
126 * decide if this flag is
\r
127 * redundant - when true it
\r
128 * would suggest that the
\r
129 * annotationElement values
\r
130 * together form a graph
\r
133 * @return the value of field 'Graph'.
\r
135 public boolean getGraph(
\r
137 return this._graph;
\r
141 * Returns the value of field 'provenance'.
\r
143 * @return the value of field 'Provenance'.
\r
145 public uk.ac.vamsas.objects.core.Provenance getProvenance(
\r
147 return this._provenance;
\r
153 * @return true if at least one Graph has been added
\r
155 public boolean hasGraph(
\r
157 return this._has_graph;
\r
161 * Overrides the java.lang.Object.hashCode method.
\r
163 * The following steps came from <b>Effective Java Programming
\r
164 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
166 * @return a hash code value for the object.
\r
168 public int hashCode(
\r
170 int result = super.hashCode();
\r
173 result = 37 * result + (_graph?0:1);
\r
174 if (_provenance != null
\r
175 && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
\r
176 result = 37 * result + _provenance.hashCode();
\r
177 org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
\r
184 * Returns the value of field 'graph'. The field 'graph' has
\r
185 * the following description: TODO:
\r
186 * decide if this flag is
\r
187 * redundant - when true it
\r
188 * would suggest that the
\r
189 * annotationElement values
\r
190 * together form a graph
\r
193 * @return the value of field 'Graph'.
\r
195 public boolean isGraph(
\r
197 return this._graph;
\r
203 * @return true if this object is valid according to the schema
\r
205 public boolean isValid(
\r
209 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
219 * @throws org.exolab.castor.xml.MarshalException if object is
\r
220 * null or if any SAXException is thrown during marshaling
\r
221 * @throws org.exolab.castor.xml.ValidationException if this
\r
222 * object is an invalid instance according to the schema
\r
224 public void marshal(
\r
225 final java.io.Writer out)
\r
226 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
227 Marshaller.marshal(this, out);
\r
234 * @throws java.io.IOException if an IOException occurs during
\r
236 * @throws org.exolab.castor.xml.ValidationException if this
\r
237 * object is an invalid instance according to the schema
\r
238 * @throws org.exolab.castor.xml.MarshalException if object is
\r
239 * null or if any SAXException is thrown during marshaling
\r
241 public void marshal(
\r
242 final org.xml.sax.ContentHandler handler)
\r
243 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
244 Marshaller.marshal(this, handler);
\r
248 * Sets the value of field 'graph'. The field 'graph' has the
\r
249 * following description: TODO:
\r
250 * decide if this flag is
\r
251 * redundant - when true it
\r
252 * would suggest that the
\r
253 * annotationElement values
\r
254 * together form a graph
\r
257 * @param graph the value of field 'graph'.
\r
259 public void setGraph(
\r
260 final boolean graph) {
\r
261 this._graph = graph;
\r
262 this._has_graph = true;
\r
266 * Sets the value of field 'provenance'.
\r
268 * @param provenance the value of field 'provenance'.
\r
270 public void setProvenance(
\r
271 final uk.ac.vamsas.objects.core.Provenance provenance) {
\r
272 this._provenance = provenance;
\r
276 * Method unmarshal.
\r
279 * @throws org.exolab.castor.xml.MarshalException if object is
\r
280 * null or if any SAXException is thrown during marshaling
\r
281 * @throws org.exolab.castor.xml.ValidationException if this
\r
282 * object is an invalid instance according to the schema
\r
283 * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
\r
285 public static uk.ac.vamsas.objects.core.RangeType unmarshal(
\r
286 final java.io.Reader reader)
\r
287 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
288 return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, reader);
\r
294 * @throws org.exolab.castor.xml.ValidationException if this
\r
295 * object is an invalid instance according to the schema
\r
297 public void validate(
\r
299 throws org.exolab.castor.xml.ValidationException {
\r
300 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
301 validator.validate(this);
\r