2 * This file is part of the Vamsas Client version 0.2.
\r
3 * Copyright 2010 by Jim Procter, Iain Milne, Pierre Marguerite,
\r
4 * Andrew Waterhouse and Dominik Lindner.
\r
6 * Earlier versions have also been incorporated into Jalview version 2.4
\r
7 * since 2008, and TOPALi version 2 since 2007.
\r
9 * The Vamsas Client is free software: you can redistribute it and/or modify
\r
10 * it under the terms of the GNU Lesser General Public License as published by
\r
11 * the Free Software Foundation, either version 3 of the License, or
\r
12 * (at your option) any later version.
\r
14 * The Vamsas Client is distributed in the hope that it will be useful,
\r
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
17 * GNU Lesser General Public License for more details.
\r
19 * You should have received a copy of the GNU Lesser General Public License
\r
20 * along with the Vamsas Client. If not, see <http://www.gnu.org/licenses/>.
\r
22 package uk.ac.vamsas.objects.core;
\r
24 //---------------------------------/
\r
25 //- Imported classes and packages -/
\r
26 //---------------------------------/
\r
28 import org.exolab.castor.xml.Marshaller;
\r
29 import org.exolab.castor.xml.Unmarshaller;
\r
34 * @version $Revision$ $Date$
\r
36 public class Mapped extends MapRangeType implements java.io.Serializable {
\r
38 // ----------------/
\r
39 // - Constructors -/
\r
40 // ----------------/
\r
51 * Overrides the java.lang.Object.equals method.
\r
54 * @return true if the objects are equal.
\r
56 public boolean equals(final java.lang.Object obj) {
\r
60 if (super.equals(obj) == false)
\r
63 if (obj instanceof Mapped) {
\r
71 * Overrides the java.lang.Object.hashCode method.
\r
73 * The following steps came from <b>Effective Java Programming Language
\r
74 * Guide</b> by Joshua Bloch, Chapter 3
\r
76 * @return a hash code value for the object.
\r
78 public int hashCode() {
\r
79 int result = super.hashCode();
\r
89 * @return true if this object is valid according to the schema
\r
91 public boolean isValid() {
\r
94 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
104 * @throws org.exolab.castor.xml.MarshalException
\r
105 * if object is null or if any SAXException is thrown during
\r
107 * @throws org.exolab.castor.xml.ValidationException
\r
108 * if this object is an invalid instance according to the schema
\r
110 public void marshal(final java.io.Writer out)
\r
111 throws org.exolab.castor.xml.MarshalException,
\r
112 org.exolab.castor.xml.ValidationException {
\r
113 Marshaller.marshal(this, out);
\r
120 * @throws java.io.IOException
\r
121 * if an IOException occurs during marshaling
\r
122 * @throws org.exolab.castor.xml.ValidationException
\r
123 * if this object is an invalid instance according to the schema
\r
124 * @throws org.exolab.castor.xml.MarshalException
\r
125 * if object is null or if any SAXException is thrown during
\r
128 public void marshal(final org.xml.sax.ContentHandler handler)
\r
129 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
\r
130 org.exolab.castor.xml.ValidationException {
\r
131 Marshaller.marshal(this, handler);
\r
135 * Method unmarshal.
\r
138 * @throws org.exolab.castor.xml.MarshalException
\r
139 * if object is null or if any SAXException is thrown during
\r
141 * @throws org.exolab.castor.xml.ValidationException
\r
142 * if this object is an invalid instance according to the schema
\r
143 * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
\r
145 public static uk.ac.vamsas.objects.core.RangeType unmarshal(
\r
146 final java.io.Reader reader)
\r
147 throws org.exolab.castor.xml.MarshalException,
\r
148 org.exolab.castor.xml.ValidationException {
\r
149 return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
\r
150 uk.ac.vamsas.objects.core.Mapped.class, reader);
\r
156 * @throws org.exolab.castor.xml.ValidationException
\r
157 * if this object is an invalid instance according to the schema
\r
159 public void validate() throws org.exolab.castor.xml.ValidationException {
\r
160 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
161 validator.validate(this);
\r