2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package uk.ac.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
18 * Class DataSetAnnotations.
20 * @version $Revision$ $Date$
22 public class DataSetAnnotations extends uk.ac.vamsas.objects.core.RangeAnnotation
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
32 * annotation is associated with a
33 * particular dataset sequence
35 private java.lang.Object _seqRef;
40 private uk.ac.vamsas.objects.core.Provenance _provenance;
47 public DataSetAnnotations() {
57 * Overrides the java.lang.Object.equals method.
60 * @return true if the objects are equal.
62 public boolean equals(
63 final java.lang.Object obj) {
67 if (super.equals(obj)==false)
70 if (obj instanceof DataSetAnnotations) {
72 DataSetAnnotations temp = (DataSetAnnotations)obj;
73 if (this._seqRef != null) {
74 if (temp._seqRef == null) return false;
75 else if (!(this._seqRef.equals(temp._seqRef)))
78 else if (temp._seqRef != null)
80 if (this._provenance != null) {
81 if (temp._provenance == null) return false;
82 else if (!(this._provenance.equals(temp._provenance)))
85 else if (temp._provenance != null)
93 * Returns the value of field 'provenance'.
95 * @return the value of field 'Provenance'.
97 public uk.ac.vamsas.objects.core.Provenance getProvenance(
99 return this._provenance;
103 * Returns the value of field 'seqRef'. The field 'seqRef' has
104 * the following description: annotation is associated with a
105 * particular dataset sequence
107 * @return the value of field 'SeqRef'.
109 public java.lang.Object getSeqRef(
115 * Overrides the java.lang.Object.hashCode method.
117 * The following steps came from <b>Effective Java Programming
118 * Language Guide</b> by Joshua Bloch, Chapter 3
120 * @return a hash code value for the object.
124 int result = super.hashCode();
127 if (_seqRef != null) {
128 result = 37 * result + _seqRef.hashCode();
130 if (_provenance != null) {
131 result = 37 * result + _provenance.hashCode();
140 * @return true if this object is valid according to the schema
142 public boolean isValid(
146 } catch (org.exolab.castor.xml.ValidationException vex) {
156 * @throws org.exolab.castor.xml.MarshalException if object is
157 * null or if any SAXException is thrown during marshaling
158 * @throws org.exolab.castor.xml.ValidationException if this
159 * object is an invalid instance according to the schema
162 final java.io.Writer out)
163 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
164 Marshaller.marshal(this, out);
171 * @throws java.io.IOException if an IOException occurs during
173 * @throws org.exolab.castor.xml.ValidationException if this
174 * object is an invalid instance according to the schema
175 * @throws org.exolab.castor.xml.MarshalException if object is
176 * null or if any SAXException is thrown during marshaling
179 final org.xml.sax.ContentHandler handler)
180 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
181 Marshaller.marshal(this, handler);
185 * Sets the value of field 'provenance'.
187 * @param provenance the value of field 'provenance'.
189 public void setProvenance(
190 final uk.ac.vamsas.objects.core.Provenance provenance) {
191 this._provenance = provenance;
195 * Sets the value of field 'seqRef'. The field 'seqRef' has the
196 * following description: annotation is associated with a
197 * particular dataset sequence
199 * @param seqRef the value of field 'seqRef'.
201 public void setSeqRef(
202 final java.lang.Object seqRef) {
203 this._seqRef = seqRef;
210 * @throws org.exolab.castor.xml.MarshalException if object is
211 * null or if any SAXException is thrown during marshaling
212 * @throws org.exolab.castor.xml.ValidationException if this
213 * object is an invalid instance according to the schema
214 * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
216 public static uk.ac.vamsas.objects.core.RangeType unmarshal(
217 final java.io.Reader reader)
218 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
219 return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSetAnnotations.class, reader);
225 * @throws org.exolab.castor.xml.ValidationException if this
226 * object is an invalid instance according to the schema
228 public void validate(
230 throws org.exolab.castor.xml.ValidationException {
231 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
232 validator.validate(this);