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;
27 * Store a list of database
29 * sequence record - with
30 * optional mapping from
31 * database sequence to the
32 * given sequence record
35 * @version $Revision$ $Date$
37 public class DbRef extends org.vamsas.client.Vobject
38 implements java.io.Serializable
42 //--------------------------/
43 //- Class/Member Variables -/
44 //--------------------------/
55 * uncontrolled/unspecified
59 private java.lang.String _source;
66 private java.lang.String _version;
81 private java.lang.String _accessionId;
89 private java.lang.String _id;
94 private java.util.Vector _mapList;
99 private java.util.Vector _linkList;
102 * Field _propertyList
104 private java.util.Vector _propertyList;
114 _mapList = new Vector();
115 _linkList = new Vector();
116 _propertyList = new Vector();
117 } //-- org.vamsas.objects.core.DbRef()
131 public void addLink(org.vamsas.objects.core.Link vLink)
132 throws java.lang.IndexOutOfBoundsException
134 _linkList.addElement(vLink);
135 } //-- void addLink(org.vamsas.objects.core.Link)
145 public void addLink(int index, org.vamsas.objects.core.Link vLink)
146 throws java.lang.IndexOutOfBoundsException
148 _linkList.insertElementAt(vLink, index);
149 } //-- void addLink(int, org.vamsas.objects.core.Link)
158 public void addMap(org.vamsas.objects.core.Map vMap)
159 throws java.lang.IndexOutOfBoundsException
161 _mapList.addElement(vMap);
162 } //-- void addMap(org.vamsas.objects.core.Map)
172 public void addMap(int index, org.vamsas.objects.core.Map vMap)
173 throws java.lang.IndexOutOfBoundsException
175 _mapList.insertElementAt(vMap, index);
176 } //-- void addMap(int, org.vamsas.objects.core.Map)
185 public void addProperty(org.vamsas.objects.core.Property vProperty)
186 throws java.lang.IndexOutOfBoundsException
188 _propertyList.addElement(vProperty);
189 } //-- void addProperty(org.vamsas.objects.core.Property)
199 public void addProperty(int index, org.vamsas.objects.core.Property vProperty)
200 throws java.lang.IndexOutOfBoundsException
202 _propertyList.insertElementAt(vProperty, index);
203 } //-- void addProperty(int, org.vamsas.objects.core.Property)
206 * Method enumerateLink
210 * @return Enumeration
212 public java.util.Enumeration enumerateLink()
214 return _linkList.elements();
215 } //-- java.util.Enumeration enumerateLink()
218 * Method enumerateMap
222 * @return Enumeration
224 public java.util.Enumeration enumerateMap()
226 return _mapList.elements();
227 } //-- java.util.Enumeration enumerateMap()
230 * Method enumerateProperty
234 * @return Enumeration
236 public java.util.Enumeration enumerateProperty()
238 return _propertyList.elements();
239 } //-- java.util.Enumeration enumerateProperty()
242 * Note: hashCode() has not been overriden
247 public boolean equals(java.lang.Object obj)
252 if (super.equals(obj)==false)
255 if (obj instanceof DbRef) {
257 DbRef temp = (DbRef)obj;
258 if (this._source != null) {
259 if (temp._source == null) return false;
260 else if (!(this._source.equals(temp._source)))
263 else if (temp._source != null)
265 if (this._version != null) {
266 if (temp._version == null) return false;
267 else if (!(this._version.equals(temp._version)))
270 else if (temp._version != null)
272 if (this._accessionId != null) {
273 if (temp._accessionId == null) return false;
274 else if (!(this._accessionId.equals(temp._accessionId)))
277 else if (temp._accessionId != null)
279 if (this._id != null) {
280 if (temp._id == null) return false;
281 else if (!(this._id.equals(temp._id)))
284 else if (temp._id != null)
286 if (this._mapList != null) {
287 if (temp._mapList == null) return false;
288 else if (!(this._mapList.equals(temp._mapList)))
291 else if (temp._mapList != null)
293 if (this._linkList != null) {
294 if (temp._linkList == null) return false;
295 else if (!(this._linkList.equals(temp._linkList)))
298 else if (temp._linkList != null)
300 if (this._propertyList != null) {
301 if (temp._propertyList == null) return false;
302 else if (!(this._propertyList.equals(temp._propertyList)))
305 else if (temp._propertyList != null)
310 } //-- boolean equals(java.lang.Object)
313 * Returns the value of field 'accessionId'. The field
314 * 'accessionId' has the following description: TODO: make some
327 * @return the value of field 'accessionId'.
329 public java.lang.String getAccessionId()
331 return this._accessionId;
332 } //-- java.lang.String getAccessionId()
335 * Returns the value of field 'id'. The field 'id' has the
336 * following description: Primary Key for
342 * @return the value of field 'id'.
344 public java.lang.String getId()
347 } //-- java.lang.String getId()
357 public org.vamsas.objects.core.Link getLink(int index)
358 throws java.lang.IndexOutOfBoundsException
360 //-- check bounds for index
361 if ((index < 0) || (index > _linkList.size())) {
362 throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]");
365 return (org.vamsas.objects.core.Link) _linkList.elementAt(index);
366 } //-- org.vamsas.objects.core.Link getLink(int)
375 public org.vamsas.objects.core.Link[] getLink()
377 int size = _linkList.size();
378 org.vamsas.objects.core.Link[] mArray = new org.vamsas.objects.core.Link[size];
379 for (int index = 0; index < size; index++) {
380 mArray[index] = (org.vamsas.objects.core.Link) _linkList.elementAt(index);
383 } //-- org.vamsas.objects.core.Link[] getLink()
386 * Method getLinkCount
392 public int getLinkCount()
394 return _linkList.size();
395 } //-- int getLinkCount()
405 public org.vamsas.objects.core.Map getMap(int index)
406 throws java.lang.IndexOutOfBoundsException
408 //-- check bounds for index
409 if ((index < 0) || (index > _mapList.size())) {
410 throw new IndexOutOfBoundsException("getMap: Index value '"+index+"' not in range [0.."+_mapList.size()+ "]");
413 return (org.vamsas.objects.core.Map) _mapList.elementAt(index);
414 } //-- org.vamsas.objects.core.Map getMap(int)
423 public org.vamsas.objects.core.Map[] getMap()
425 int size = _mapList.size();
426 org.vamsas.objects.core.Map[] mArray = new org.vamsas.objects.core.Map[size];
427 for (int index = 0; index < size; index++) {
428 mArray[index] = (org.vamsas.objects.core.Map) _mapList.elementAt(index);
431 } //-- org.vamsas.objects.core.Map[] getMap()
440 public int getMapCount()
442 return _mapList.size();
443 } //-- int getMapCount()
453 public org.vamsas.objects.core.Property getProperty(int index)
454 throws java.lang.IndexOutOfBoundsException
456 //-- check bounds for index
457 if ((index < 0) || (index > _propertyList.size())) {
458 throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
461 return (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
462 } //-- org.vamsas.objects.core.Property getProperty(int)
471 public org.vamsas.objects.core.Property[] getProperty()
473 int size = _propertyList.size();
474 org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size];
475 for (int index = 0; index < size; index++) {
476 mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
479 } //-- org.vamsas.objects.core.Property[] getProperty()
482 * Method getPropertyCount
488 public int getPropertyCount()
490 return _propertyList.size();
491 } //-- int getPropertyCount()
494 * Returns the value of field 'source'. The field 'source' has
495 * the following description: TODO Database
503 * uncontrolled/unspecified
508 * @return the value of field 'source'.
510 public java.lang.String getSource()
513 } //-- java.lang.String getSource()
516 * Returns the value of field 'version'. The field 'version'
517 * has the following description: Version must be
522 * @return the value of field 'version'.
524 public java.lang.String getVersion()
526 return this._version;
527 } //-- java.lang.String getVersion()
536 public boolean isValid()
541 catch (org.exolab.castor.xml.ValidationException vex) {
545 } //-- boolean isValid()
554 public void marshal(java.io.Writer out)
555 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
558 Marshaller.marshal(this, out);
559 } //-- void marshal(java.io.Writer)
568 public void marshal(org.xml.sax.ContentHandler handler)
569 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
572 Marshaller.marshal(this, handler);
573 } //-- void marshal(org.xml.sax.ContentHandler)
576 * Method removeAllLink
579 public void removeAllLink()
581 _linkList.removeAllElements();
582 } //-- void removeAllLink()
585 * Method removeAllMap
588 public void removeAllMap()
590 _mapList.removeAllElements();
591 } //-- void removeAllMap()
594 * Method removeAllProperty
597 public void removeAllProperty()
599 _propertyList.removeAllElements();
600 } //-- void removeAllProperty()
610 public org.vamsas.objects.core.Link removeLink(int index)
612 java.lang.Object obj = _linkList.elementAt(index);
613 _linkList.removeElementAt(index);
614 return (org.vamsas.objects.core.Link) obj;
615 } //-- org.vamsas.objects.core.Link removeLink(int)
625 public org.vamsas.objects.core.Map removeMap(int index)
627 java.lang.Object obj = _mapList.elementAt(index);
628 _mapList.removeElementAt(index);
629 return (org.vamsas.objects.core.Map) obj;
630 } //-- org.vamsas.objects.core.Map removeMap(int)
633 * Method removeProperty
640 public org.vamsas.objects.core.Property removeProperty(int index)
642 java.lang.Object obj = _propertyList.elementAt(index);
643 _propertyList.removeElementAt(index);
644 return (org.vamsas.objects.core.Property) obj;
645 } //-- org.vamsas.objects.core.Property removeProperty(int)
648 * Sets the value of field 'accessionId'. The field
649 * 'accessionId' has the following description: TODO: make some
661 * @param accessionId the value of field 'accessionId'.
663 public void setAccessionId(java.lang.String accessionId)
665 this._accessionId = accessionId;
666 } //-- void setAccessionId(java.lang.String)
669 * Sets the value of field 'id'. The field 'id' has the
670 * following description: Primary Key for
675 * @param id the value of field 'id'.
677 public void setId(java.lang.String id)
680 } //-- void setId(java.lang.String)
690 public void setLink(int index, org.vamsas.objects.core.Link vLink)
691 throws java.lang.IndexOutOfBoundsException
693 //-- check bounds for index
694 if ((index < 0) || (index > _linkList.size())) {
695 throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]");
697 _linkList.setElementAt(vLink, index);
698 } //-- void setLink(int, org.vamsas.objects.core.Link)
707 public void setLink(org.vamsas.objects.core.Link[] linkArray)
710 _linkList.removeAllElements();
711 for (int i = 0; i < linkArray.length; i++) {
712 _linkList.addElement(linkArray[i]);
714 } //-- void setLink(org.vamsas.objects.core.Link)
724 public void setMap(int index, org.vamsas.objects.core.Map vMap)
725 throws java.lang.IndexOutOfBoundsException
727 //-- check bounds for index
728 if ((index < 0) || (index > _mapList.size())) {
729 throw new IndexOutOfBoundsException("setMap: Index value '"+index+"' not in range [0.."+_mapList.size()+ "]");
731 _mapList.setElementAt(vMap, index);
732 } //-- void setMap(int, org.vamsas.objects.core.Map)
741 public void setMap(org.vamsas.objects.core.Map[] mapArray)
744 _mapList.removeAllElements();
745 for (int i = 0; i < mapArray.length; i++) {
746 _mapList.addElement(mapArray[i]);
748 } //-- void setMap(org.vamsas.objects.core.Map)
758 public void setProperty(int index, org.vamsas.objects.core.Property vProperty)
759 throws java.lang.IndexOutOfBoundsException
761 //-- check bounds for index
762 if ((index < 0) || (index > _propertyList.size())) {
763 throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
765 _propertyList.setElementAt(vProperty, index);
766 } //-- void setProperty(int, org.vamsas.objects.core.Property)
773 * @param propertyArray
775 public void setProperty(org.vamsas.objects.core.Property[] propertyArray)
778 _propertyList.removeAllElements();
779 for (int i = 0; i < propertyArray.length; i++) {
780 _propertyList.addElement(propertyArray[i]);
782 } //-- void setProperty(org.vamsas.objects.core.Property)
785 * Sets the value of field 'source'. The field 'source' has the
786 * following description: TODO Database
794 * uncontrolled/unspecified
798 * @param source the value of field 'source'.
800 public void setSource(java.lang.String source)
802 this._source = source;
803 } //-- void setSource(java.lang.String)
806 * Sets the value of field 'version'. The field 'version' has
807 * the following description: Version must be
811 * @param version the value of field 'version'.
813 public void setVersion(java.lang.String version)
815 this._version = version;
816 } //-- void setVersion(java.lang.String)
826 public static org.vamsas.objects.core.DbRef unmarshal(java.io.Reader reader)
827 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
829 return (org.vamsas.objects.core.DbRef) Unmarshaller.unmarshal(org.vamsas.objects.core.DbRef.class, reader);
830 } //-- org.vamsas.objects.core.DbRef unmarshal(java.io.Reader)
836 public void validate()
837 throws org.exolab.castor.xml.ValidationException
839 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
840 validator.validate(this);
841 } //-- void validate()