cb41ef97362c3b69cc57f239338259e8d7d40fff
[vamsas.git] / src / uk / ac / vamsas / objects / core / LockFile.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package uk.ac.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class LockFile.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class LockFile extends uk.ac.vamsas.client.Vobject 
23 implements java.io.Serializable
24 {
25
26
27       //--------------------------/
28      //- Class/Member Variables -/
29     //--------------------------/
30
31     /**
32      * internal content storage
33      */
34     private java.lang.String _content = "";
35
36
37       //----------------/
38      //- Constructors -/
39     //----------------/
40
41     public LockFile() {
42         super();
43         setContent("");
44     }
45
46
47       //-----------/
48      //- Methods -/
49     //-----------/
50
51     /**
52      * Overrides the java.lang.Object.equals method.
53      * 
54      * @param obj
55      * @return true if the objects are equal.
56      */
57     public boolean equals(
58             final java.lang.Object obj) {
59         if ( this == obj )
60             return true;
61         
62         if (super.equals(obj)==false)
63             return false;
64         
65         if (obj instanceof LockFile) {
66         
67             LockFile temp = (LockFile)obj;
68             boolean thcycle;
69             boolean tmcycle;
70             if (this._content != null) {
71                 if (temp._content == null) return false;
72                 if (this._content != temp._content) {
73                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
74                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
75                     if (thcycle!=tmcycle) {
76                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
77                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
78                         return false;
79                     }
80                     if (!thcycle) {
81                         if (!this._content.equals(temp._content)) {
82                             org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
83                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
84                             return false;
85                         }
86                         org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
87                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
88                     }
89                 }
90             } else if (temp._content != null)
91                 return false;
92             return true;
93         }
94         return false;
95     }
96
97     /**
98      * Returns the value of field 'content'. The field 'content'
99      * has the following description: internal content storage
100      * 
101      * @return the value of field 'Content'.
102      */
103     public java.lang.String getContent(
104     ) {
105         return this._content;
106     }
107
108     /**
109      * Overrides the java.lang.Object.hashCode method.
110      * <p>
111      * The following steps came from <b>Effective Java Programming
112      * Language Guide</b> by Joshua Bloch, Chapter 3
113      * 
114      * @return a hash code value for the object.
115      */
116     public int hashCode(
117     ) {
118         int result = super.hashCode();
119         
120         long tmp;
121         if (_content != null
122             && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
123            result = 37 * result + _content.hashCode();
124            org.castor.util.CycleBreaker.releaseCycleHandle(_content);
125         }
126         
127         return result;
128     }
129
130     /**
131      * Method isValid.
132      * 
133      * @return true if this object is valid according to the schema
134      */
135     public boolean isValid(
136     ) {
137         try {
138             validate();
139         } catch (org.exolab.castor.xml.ValidationException vex) {
140             return false;
141         }
142         return true;
143     }
144
145     /**
146      * 
147      * 
148      * @param out
149      * @throws org.exolab.castor.xml.MarshalException if object is
150      * null or if any SAXException is thrown during marshaling
151      * @throws org.exolab.castor.xml.ValidationException if this
152      * object is an invalid instance according to the schema
153      */
154     public void marshal(
155             final java.io.Writer out)
156     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
157         Marshaller.marshal(this, out);
158     }
159
160     /**
161      * 
162      * 
163      * @param handler
164      * @throws java.io.IOException if an IOException occurs during
165      * marshaling
166      * @throws org.exolab.castor.xml.ValidationException if this
167      * object is an invalid instance according to the schema
168      * @throws org.exolab.castor.xml.MarshalException if object is
169      * null or if any SAXException is thrown during marshaling
170      */
171     public void marshal(
172             final org.xml.sax.ContentHandler handler)
173     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
174         Marshaller.marshal(this, handler);
175     }
176
177     /**
178      * Sets the value of field 'content'. The field 'content' has
179      * the following description: internal content storage
180      * 
181      * @param content the value of field 'content'.
182      */
183     public void setContent(
184             final java.lang.String content) {
185         this._content = content;
186     }
187
188     /**
189      * Method unmarshal.
190      * 
191      * @param reader
192      * @throws org.exolab.castor.xml.MarshalException if object is
193      * null or if any SAXException is thrown during marshaling
194      * @throws org.exolab.castor.xml.ValidationException if this
195      * object is an invalid instance according to the schema
196      * @return the unmarshaled uk.ac.vamsas.objects.core.LockFile
197      */
198     public static uk.ac.vamsas.objects.core.LockFile unmarshal(
199             final java.io.Reader reader)
200     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
201         return (uk.ac.vamsas.objects.core.LockFile) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.LockFile.class, reader);
202     }
203
204     /**
205      * 
206      * 
207      * @throws org.exolab.castor.xml.ValidationException if this
208      * object is an invalid instance according to the schema
209      */
210     public void validate(
211     )
212     throws org.exolab.castor.xml.ValidationException {
213         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
214         validator.validate(this);
215     }
216
217 }