2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
8 package org.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.Enumeration;
19 import java.util.Vector;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler;
29 * @version $Revision$ $Date$
31 public class Sequence extends org.vamsas.objects.core.SequenceType
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
43 private java.lang.String _id;
48 private java.lang.String _dictionary;
53 private java.util.Vector _dbRefList;
63 _dbRefList = new Vector();
64 } //-- org.vamsas.objects.core.Sequence()
78 public void addDbRef(org.vamsas.objects.core.DbRef vDbRef)
79 throws java.lang.IndexOutOfBoundsException
81 _dbRefList.addElement(vDbRef);
82 } //-- void addDbRef(org.vamsas.objects.core.DbRef)
92 public void addDbRef(int index, org.vamsas.objects.core.DbRef vDbRef)
93 throws java.lang.IndexOutOfBoundsException
95 _dbRefList.insertElementAt(vDbRef, index);
96 } //-- void addDbRef(int, org.vamsas.objects.core.DbRef)
99 * Method enumerateDbRef
103 * @return Enumeration
105 public java.util.Enumeration enumerateDbRef()
107 return _dbRefList.elements();
108 } //-- java.util.Enumeration enumerateDbRef()
111 * Note: hashCode() has not been overriden
116 public boolean equals(java.lang.Object obj)
121 if (super.equals(obj)==false)
124 if (obj instanceof Sequence) {
126 Sequence temp = (Sequence)obj;
127 if (this._id != null) {
128 if (temp._id == null) return false;
129 else if (!(this._id.equals(temp._id)))
132 else if (temp._id != null)
134 if (this._dictionary != null) {
135 if (temp._dictionary == null) return false;
136 else if (!(this._dictionary.equals(temp._dictionary)))
139 else if (temp._dictionary != null)
141 if (this._dbRefList != null) {
142 if (temp._dbRefList == null) return false;
143 else if (!(this._dbRefList.equals(temp._dbRefList)))
146 else if (temp._dbRefList != null)
151 } //-- boolean equals(java.lang.Object)
161 public org.vamsas.objects.core.DbRef getDbRef(int index)
162 throws java.lang.IndexOutOfBoundsException
164 //-- check bounds for index
165 if ((index < 0) || (index > _dbRefList.size())) {
166 throw new IndexOutOfBoundsException("getDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]");
169 return (org.vamsas.objects.core.DbRef) _dbRefList.elementAt(index);
170 } //-- org.vamsas.objects.core.DbRef getDbRef(int)
179 public org.vamsas.objects.core.DbRef[] getDbRef()
181 int size = _dbRefList.size();
182 org.vamsas.objects.core.DbRef[] mArray = new org.vamsas.objects.core.DbRef[size];
183 for (int index = 0; index < size; index++) {
184 mArray[index] = (org.vamsas.objects.core.DbRef) _dbRefList.elementAt(index);
187 } //-- org.vamsas.objects.core.DbRef[] getDbRef()
190 * Method getDbRefCount
196 public int getDbRefCount()
198 return _dbRefList.size();
199 } //-- int getDbRefCount()
202 * Returns the value of field 'dictionary'.
205 * @return the value of field 'dictionary'.
207 public java.lang.String getDictionary()
209 return this._dictionary;
210 } //-- java.lang.String getDictionary()
213 * Returns the value of field 'id'.
216 * @return the value of field 'id'.
218 public java.lang.String getId()
221 } //-- java.lang.String getId()
230 public boolean isValid()
235 catch (org.exolab.castor.xml.ValidationException vex) {
239 } //-- boolean isValid()
248 public void marshal(java.io.Writer out)
249 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
252 Marshaller.marshal(this, out);
253 } //-- void marshal(java.io.Writer)
262 public void marshal(org.xml.sax.ContentHandler handler)
263 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
266 Marshaller.marshal(this, handler);
267 } //-- void marshal(org.xml.sax.ContentHandler)
270 * Method removeAllDbRef
273 public void removeAllDbRef()
275 _dbRefList.removeAllElements();
276 } //-- void removeAllDbRef()
286 public org.vamsas.objects.core.DbRef removeDbRef(int index)
288 java.lang.Object obj = _dbRefList.elementAt(index);
289 _dbRefList.removeElementAt(index);
290 return (org.vamsas.objects.core.DbRef) obj;
291 } //-- org.vamsas.objects.core.DbRef removeDbRef(int)
301 public void setDbRef(int index, org.vamsas.objects.core.DbRef vDbRef)
302 throws java.lang.IndexOutOfBoundsException
304 //-- check bounds for index
305 if ((index < 0) || (index > _dbRefList.size())) {
306 throw new IndexOutOfBoundsException("setDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]");
308 _dbRefList.setElementAt(vDbRef, index);
309 } //-- void setDbRef(int, org.vamsas.objects.core.DbRef)
318 public void setDbRef(org.vamsas.objects.core.DbRef[] dbRefArray)
321 _dbRefList.removeAllElements();
322 for (int i = 0; i < dbRefArray.length; i++) {
323 _dbRefList.addElement(dbRefArray[i]);
325 } //-- void setDbRef(org.vamsas.objects.core.DbRef)
328 * Sets the value of field 'dictionary'.
330 * @param dictionary the value of field 'dictionary'.
332 public void setDictionary(java.lang.String dictionary)
334 this._dictionary = dictionary;
335 } //-- void setDictionary(java.lang.String)
338 * Sets the value of field 'id'.
340 * @param id the value of field 'id'.
342 public void setId(java.lang.String id)
345 } //-- void setId(java.lang.String)
353 * @return SequenceType
355 public static org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader)
356 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
358 return (org.vamsas.objects.core.Sequence) Unmarshaller.unmarshal(org.vamsas.objects.core.Sequence.class, reader);
359 } //-- org.vamsas.objects.core.SequenceType unmarshal(java.io.Reader)
365 public void validate()
366 throws org.exolab.castor.xml.ValidationException
368 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
369 validator.validate(this);
370 } //-- void validate()