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
20 * @version $Revision$ $Date$
\r
22 public class AppData extends uk.ac.vamsas.client.Vobject
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
32 * Internal choice value storage
\r
34 private java.lang.Object _choiceValue;
\r
39 private byte[] _data;
\r
42 * Field _dataReference.
\r
44 private java.lang.String _dataReference;
\r
61 * Overrides the java.lang.Object.equals method.
\r
64 * @return true if the objects are equal.
\r
66 public boolean equals(
\r
67 final java.lang.Object obj) {
\r
71 if (super.equals(obj)==false)
\r
74 if (obj instanceof AppData) {
\r
76 AppData temp = (AppData)obj;
\r
79 if (this._choiceValue != null) {
\r
80 if (temp._choiceValue == null) return false;
\r
81 if (this._choiceValue != temp._choiceValue) {
\r
82 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._choiceValue);
\r
83 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._choiceValue);
\r
84 if (thcycle!=tmcycle) {
\r
85 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); };
\r
86 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); };
\r
90 if (!this._choiceValue.equals(temp._choiceValue)) {
\r
91 org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue);
\r
92 org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue);
\r
95 org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue);
\r
96 org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue);
\r
99 } else if (temp._choiceValue != null)
\r
101 if (this._data != null) {
\r
102 if (temp._data == null) return false;
\r
103 if (this._data != temp._data) {
\r
104 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._data);
\r
105 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._data);
\r
106 if (thcycle!=tmcycle) {
\r
107 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._data); };
\r
108 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._data); };
\r
112 if (!java.util.Arrays.equals(this._data, temp._data)) {
\r
113 org.castor.util.CycleBreaker.releaseCycleHandle(this._data);
\r
114 org.castor.util.CycleBreaker.releaseCycleHandle(temp._data);
\r
117 org.castor.util.CycleBreaker.releaseCycleHandle(this._data);
\r
118 org.castor.util.CycleBreaker.releaseCycleHandle(temp._data);
\r
121 } else if (temp._data != null)
\r
123 if (this._dataReference != null) {
\r
124 if (temp._dataReference == null) return false;
\r
125 if (this._dataReference != temp._dataReference) {
\r
126 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataReference);
\r
127 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataReference);
\r
128 if (thcycle!=tmcycle) {
\r
129 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference); };
\r
130 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference); };
\r
134 if (!this._dataReference.equals(temp._dataReference)) {
\r
135 org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference);
\r
136 org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference);
\r
139 org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference);
\r
140 org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference);
\r
143 } else if (temp._dataReference != null)
\r
151 * Returns the value of field 'choiceValue'. The field
\r
152 * 'choiceValue' has the following description: Internal choice
\r
155 * @return the value of field 'ChoiceValue'.
\r
157 public java.lang.Object getChoiceValue(
\r
159 return this._choiceValue;
\r
163 * Returns the value of field 'data'.
\r
165 * @return the value of field 'Data'.
\r
167 public byte[] getData(
\r
173 * Returns the value of field 'dataReference'.
\r
175 * @return the value of field 'DataReference'.
\r
177 public java.lang.String getDataReference(
\r
179 return this._dataReference;
\r
183 * Overrides the java.lang.Object.hashCode method.
\r
185 * The following steps came from <b>Effective Java Programming
\r
186 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
188 * @return a hash code value for the object.
\r
190 public int hashCode(
\r
192 int result = super.hashCode();
\r
195 if (_choiceValue != null
\r
196 && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) {
\r
197 result = 37 * result + _choiceValue.hashCode();
\r
198 org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue);
\r
201 && !org.castor.util.CycleBreaker.startingToCycle(_data)) {
\r
202 result = 37 * result + _data.hashCode();
\r
203 org.castor.util.CycleBreaker.releaseCycleHandle(_data);
\r
205 if (_dataReference != null
\r
206 && !org.castor.util.CycleBreaker.startingToCycle(_dataReference)) {
\r
207 result = 37 * result + _dataReference.hashCode();
\r
208 org.castor.util.CycleBreaker.releaseCycleHandle(_dataReference);
\r
217 * @return true if this object is valid according to the schema
\r
219 public boolean isValid(
\r
223 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
233 * @throws org.exolab.castor.xml.MarshalException if object is
\r
234 * null or if any SAXException is thrown during marshaling
\r
235 * @throws org.exolab.castor.xml.ValidationException if this
\r
236 * object is an invalid instance according to the schema
\r
238 public void marshal(
\r
239 final java.io.Writer out)
\r
240 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
241 Marshaller.marshal(this, out);
\r
248 * @throws java.io.IOException if an IOException occurs during
\r
250 * @throws org.exolab.castor.xml.ValidationException if this
\r
251 * object is an invalid instance according to the schema
\r
252 * @throws org.exolab.castor.xml.MarshalException if object is
\r
253 * null or if any SAXException is thrown during marshaling
\r
255 public void marshal(
\r
256 final org.xml.sax.ContentHandler handler)
\r
257 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
258 Marshaller.marshal(this, handler);
\r
262 * Sets the value of field 'data'.
\r
264 * @param data the value of field 'data'.
\r
266 public void setData(
\r
267 final byte[] data) {
\r
269 this._choiceValue = data;
\r
273 * Sets the value of field 'dataReference'.
\r
275 * @param dataReference the value of field 'dataReference'.
\r
277 public void setDataReference(
\r
278 final java.lang.String dataReference) {
\r
279 this._dataReference = dataReference;
\r
280 this._choiceValue = dataReference;
\r
284 * Method unmarshal.
\r
287 * @throws org.exolab.castor.xml.MarshalException if object is
\r
288 * null or if any SAXException is thrown during marshaling
\r
289 * @throws org.exolab.castor.xml.ValidationException if this
\r
290 * object is an invalid instance according to the schema
\r
291 * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
\r
293 public static uk.ac.vamsas.objects.core.AppData unmarshal(
\r
294 final java.io.Reader reader)
\r
295 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
296 return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AppData.class, reader);
\r
302 * @throws org.exolab.castor.xml.ValidationException if this
\r
303 * object is an invalid instance according to the schema
\r
305 public void validate(
\r
307 throws org.exolab.castor.xml.ValidationException {
\r
308 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
309 validator.validate(this);
\r