87f044488826fe62d38f05ccb1f3721133ec201b
[vamsas.git] / src / uk / ac / vamsas / objects / core / Vref.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package uk.ac.vamsas.objects.core;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import org.exolab.castor.xml.Marshaller;\r
15 import org.exolab.castor.xml.Unmarshaller;\r
16 \r
17 /**\r
18  * Direct associations between this node and any vamsas\r
19  *  objects\r
20  * \r
21  * @version $Revision$ $Date$\r
22  */\r
23 public class Vref extends ReferenceType \r
24 implements java.io.Serializable\r
25 {\r
26 \r
27 \r
28       //----------------/\r
29      //- Constructors -/\r
30     //----------------/\r
31 \r
32     public Vref() {\r
33         super();\r
34     }\r
35 \r
36 \r
37       //-----------/\r
38      //- Methods -/\r
39     //-----------/\r
40 \r
41     /**\r
42      * Overrides the java.lang.Object.equals method.\r
43      * \r
44      * @param obj\r
45      * @return true if the objects are equal.\r
46      */\r
47     public boolean equals(\r
48             final java.lang.Object obj) {\r
49         if ( this == obj )\r
50             return true;\r
51         \r
52         if (super.equals(obj)==false)\r
53             return false;\r
54         \r
55         if (obj instanceof Vref) {\r
56         \r
57         return true;\r
58     }\r
59     return false;\r
60     }\r
61 \r
62     /**\r
63      * Overrides the java.lang.Object.hashCode method.\r
64      * <p>\r
65      * The following steps came from <b>Effective Java Programming\r
66      * Language Guide</b> by Joshua Bloch, Chapter 3\r
67      * \r
68      * @return a hash code value for the object.\r
69      */\r
70     public int hashCode(\r
71     ) {\r
72         int result = super.hashCode();\r
73         \r
74         long tmp;\r
75         \r
76         return result;\r
77     }\r
78 \r
79     /**\r
80      * Method isValid.\r
81      * \r
82      * @return true if this object is valid according to the schema\r
83      */\r
84     public boolean isValid(\r
85     ) {\r
86         try {\r
87             validate();\r
88         } catch (org.exolab.castor.xml.ValidationException vex) {\r
89             return false;\r
90         }\r
91         return true;\r
92     }\r
93 \r
94     /**\r
95      * \r
96      * \r
97      * @param out\r
98      * @throws org.exolab.castor.xml.MarshalException if object is\r
99      * null or if any SAXException is thrown during marshaling\r
100      * @throws org.exolab.castor.xml.ValidationException if this\r
101      * object is an invalid instance according to the schema\r
102      */\r
103     public void marshal(\r
104             final java.io.Writer out)\r
105     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
106         Marshaller.marshal(this, out);\r
107     }\r
108 \r
109     /**\r
110      * \r
111      * \r
112      * @param handler\r
113      * @throws java.io.IOException if an IOException occurs during\r
114      * marshaling\r
115      * @throws org.exolab.castor.xml.ValidationException if this\r
116      * object is an invalid instance according to the schema\r
117      * @throws org.exolab.castor.xml.MarshalException if object is\r
118      * null or if any SAXException is thrown during marshaling\r
119      */\r
120     public void marshal(\r
121             final org.xml.sax.ContentHandler handler)\r
122     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
123         Marshaller.marshal(this, handler);\r
124     }\r
125 \r
126     /**\r
127      * Method unmarshal.\r
128      * \r
129      * @param reader\r
130      * @throws org.exolab.castor.xml.MarshalException if object is\r
131      * null or if any SAXException is thrown during marshaling\r
132      * @throws org.exolab.castor.xml.ValidationException if this\r
133      * object is an invalid instance according to the schema\r
134      * @return the unmarshaled\r
135      * uk.ac.vamsas.objects.core.ReferenceType\r
136      */\r
137     public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(\r
138             final java.io.Reader reader)\r
139     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
140         return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Vref.class, reader);\r
141     }\r
142 \r
143     /**\r
144      * \r
145      * \r
146      * @throws org.exolab.castor.xml.ValidationException if this\r
147      * object is an invalid instance according to the schema\r
148      */\r
149     public void validate(\r
150     )\r
151     throws org.exolab.castor.xml.ValidationException {\r
152         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
153         validator.validate(this);\r
154     }\r
155 \r
156 }\r