2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package uk.ac.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class Entry extends uk.ac.vamsas.client.Vobject
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
32 * Primary Key for vamsas object referencing
35 private java.lang.String _id;
40 private java.lang.String _user;
43 * With which application
45 private java.lang.String _app;
50 private java.lang.String _action;
53 * When : TODO: change to dateTime for release
55 private org.exolab.castor.types.Date _date;
58 * additional information
60 private java.util.Vector _propertyList;
63 * parameter for the action
65 private java.util.Vector _paramList;
68 * bioinformatic objects input to action
71 private java.util.Vector _inputList;
80 this._propertyList = new java.util.Vector();
81 this._paramList = new java.util.Vector();
82 this._inputList = new java.util.Vector();
94 * @throws java.lang.IndexOutOfBoundsException if the index
95 * given is outside the bounds of the collection
98 final uk.ac.vamsas.objects.core.Input vInput)
99 throws java.lang.IndexOutOfBoundsException {
100 this._inputList.addElement(vInput);
108 * @throws java.lang.IndexOutOfBoundsException if the index
109 * given is outside the bounds of the collection
111 public void addInput(
113 final uk.ac.vamsas.objects.core.Input vInput)
114 throws java.lang.IndexOutOfBoundsException {
115 this._inputList.add(index, vInput);
122 * @throws java.lang.IndexOutOfBoundsException if the index
123 * given is outside the bounds of the collection
125 public void addParam(
126 final uk.ac.vamsas.objects.core.Param vParam)
127 throws java.lang.IndexOutOfBoundsException {
128 this._paramList.addElement(vParam);
136 * @throws java.lang.IndexOutOfBoundsException if the index
137 * given is outside the bounds of the collection
139 public void addParam(
141 final uk.ac.vamsas.objects.core.Param vParam)
142 throws java.lang.IndexOutOfBoundsException {
143 this._paramList.add(index, vParam);
150 * @throws java.lang.IndexOutOfBoundsException if the index
151 * given is outside the bounds of the collection
153 public void addProperty(
154 final uk.ac.vamsas.objects.core.Property vProperty)
155 throws java.lang.IndexOutOfBoundsException {
156 this._propertyList.addElement(vProperty);
164 * @throws java.lang.IndexOutOfBoundsException if the index
165 * given is outside the bounds of the collection
167 public void addProperty(
169 final uk.ac.vamsas.objects.core.Property vProperty)
170 throws java.lang.IndexOutOfBoundsException {
171 this._propertyList.add(index, vProperty);
175 * Method enumerateInput.
177 * @return an Enumeration over all
178 * uk.ac.vamsas.objects.core.Input elements
180 public java.util.Enumeration enumerateInput(
182 return this._inputList.elements();
186 * Method enumerateParam.
188 * @return an Enumeration over all
189 * uk.ac.vamsas.objects.core.Param elements
191 public java.util.Enumeration enumerateParam(
193 return this._paramList.elements();
197 * Method enumerateProperty.
199 * @return an Enumeration over all
200 * uk.ac.vamsas.objects.core.Property elements
202 public java.util.Enumeration enumerateProperty(
204 return this._propertyList.elements();
208 * Overrides the java.lang.Object.equals method.
211 * @return true if the objects are equal.
213 public boolean equals(
214 final java.lang.Object obj) {
218 if (super.equals(obj)==false)
221 if (obj instanceof Entry) {
223 Entry temp = (Entry)obj;
224 if (this._id != null) {
225 if (temp._id == null) return false;
226 else if (!(this._id.equals(temp._id)))
229 else if (temp._id != null)
231 if (this._user != null) {
232 if (temp._user == null) return false;
233 else if (!(this._user.equals(temp._user)))
236 else if (temp._user != null)
238 if (this._app != null) {
239 if (temp._app == null) return false;
240 else if (!(this._app.equals(temp._app)))
243 else if (temp._app != null)
245 if (this._action != null) {
246 if (temp._action == null) return false;
247 else if (!(this._action.equals(temp._action)))
250 else if (temp._action != null)
252 if (this._date != null) {
253 if (temp._date == null) return false;
254 else if (!(this._date.equals(temp._date)))
257 else if (temp._date != null)
259 if (this._propertyList != null) {
260 if (temp._propertyList == null) return false;
261 else if (!(this._propertyList.equals(temp._propertyList)))
264 else if (temp._propertyList != null)
266 if (this._paramList != null) {
267 if (temp._paramList == null) return false;
268 else if (!(this._paramList.equals(temp._paramList)))
271 else if (temp._paramList != null)
273 if (this._inputList != null) {
274 if (temp._inputList == null) return false;
275 else if (!(this._inputList.equals(temp._inputList)))
278 else if (temp._inputList != null)
286 * Returns the value of field 'action'. The field 'action' has
287 * the following description: Did what
289 * @return the value of field 'Action'.
291 public java.lang.String getAction(
297 * Returns the value of field 'app'. The field 'app' has the
298 * following description: With which application
300 * @return the value of field 'App'.
302 public java.lang.String getApp(
308 * Returns the value of field 'date'. The field 'date' has the
309 * following description: When : TODO: change to dateTime for
312 * @return the value of field 'Date'.
314 public org.exolab.castor.types.Date getDate(
320 * Returns the value of field 'id'. The field 'id' has the
321 * following description: Primary Key for vamsas object
325 * @return the value of field 'Id'.
327 public java.lang.String getId(
336 * @throws java.lang.IndexOutOfBoundsException if the index
337 * given is outside the bounds of the collection
338 * @return the value of the uk.ac.vamsas.objects.core.Input at
341 public uk.ac.vamsas.objects.core.Input getInput(
343 throws java.lang.IndexOutOfBoundsException {
344 // check bounds for index
345 if (index < 0 || index >= this._inputList.size()) {
346 throw new IndexOutOfBoundsException("getInput: Index value '" + index + "' not in range [0.." + (this._inputList.size() - 1) + "]");
349 return (uk.ac.vamsas.objects.core.Input) _inputList.get(index);
353 * Method getInput.Returns the contents of the collection in an
354 * Array. <p>Note: Just in case the collection contents are
355 * changing in another thread, we pass a 0-length Array of the
356 * correct type into the API call. This way we <i>know</i>
357 * that the Array returned is of exactly the correct length.
359 * @return this collection as an Array
361 public uk.ac.vamsas.objects.core.Input[] getInput(
363 uk.ac.vamsas.objects.core.Input[] array = new uk.ac.vamsas.objects.core.Input[0];
364 return (uk.ac.vamsas.objects.core.Input[]) this._inputList.toArray(array);
368 * Method getInputAsReference.Returns a reference to
369 * '_inputList'. No type checking is performed on any
370 * modifications to the Vector.
372 * @return a reference to the Vector backing this class
374 public java.util.Vector getInputAsReference(
376 return this._inputList;
380 * Method getInputCount.
382 * @return the size of this collection
384 public int getInputCount(
386 return this._inputList.size();
393 * @throws java.lang.IndexOutOfBoundsException if the index
394 * given is outside the bounds of the collection
395 * @return the value of the uk.ac.vamsas.objects.core.Param at
398 public uk.ac.vamsas.objects.core.Param getParam(
400 throws java.lang.IndexOutOfBoundsException {
401 // check bounds for index
402 if (index < 0 || index >= this._paramList.size()) {
403 throw new IndexOutOfBoundsException("getParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]");
406 return (uk.ac.vamsas.objects.core.Param) _paramList.get(index);
410 * Method getParam.Returns the contents of the collection in an
411 * Array. <p>Note: Just in case the collection contents are
412 * changing in another thread, we pass a 0-length Array of the
413 * correct type into the API call. This way we <i>know</i>
414 * that the Array returned is of exactly the correct length.
416 * @return this collection as an Array
418 public uk.ac.vamsas.objects.core.Param[] getParam(
420 uk.ac.vamsas.objects.core.Param[] array = new uk.ac.vamsas.objects.core.Param[0];
421 return (uk.ac.vamsas.objects.core.Param[]) this._paramList.toArray(array);
425 * Method getParamAsReference.Returns a reference to
426 * '_paramList'. No type checking is performed on any
427 * modifications to the Vector.
429 * @return a reference to the Vector backing this class
431 public java.util.Vector getParamAsReference(
433 return this._paramList;
437 * Method getParamCount.
439 * @return the size of this collection
441 public int getParamCount(
443 return this._paramList.size();
447 * Method getProperty.
450 * @throws java.lang.IndexOutOfBoundsException if the index
451 * given is outside the bounds of the collection
452 * @return the value of the uk.ac.vamsas.objects.core.Property
455 public uk.ac.vamsas.objects.core.Property getProperty(
457 throws java.lang.IndexOutOfBoundsException {
458 // check bounds for index
459 if (index < 0 || index >= this._propertyList.size()) {
460 throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
463 return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
467 * Method getProperty.Returns the contents of the collection in
468 * an Array. <p>Note: Just in case the collection contents
469 * are changing in another thread, we pass a 0-length Array of
470 * the correct type into the API call. This way we <i>know</i>
471 * that the Array returned is of exactly the correct length.
473 * @return this collection as an Array
475 public uk.ac.vamsas.objects.core.Property[] getProperty(
477 uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
478 return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
482 * Method getPropertyAsReference.Returns a reference to
483 * '_propertyList'. No type checking is performed on any
484 * modifications to the Vector.
486 * @return a reference to the Vector backing this class
488 public java.util.Vector getPropertyAsReference(
490 return this._propertyList;
494 * Method getPropertyCount.
496 * @return the size of this collection
498 public int getPropertyCount(
500 return this._propertyList.size();
504 * Returns the value of field 'user'. The field 'user' has the
505 * following description: Who
507 * @return the value of field 'User'.
509 public java.lang.String getUser(
515 * Overrides the java.lang.Object.hashCode method.
517 * The following steps came from <b>Effective Java Programming
518 * Language Guide</b> by Joshua Bloch, Chapter 3
520 * @return a hash code value for the object.
524 int result = super.hashCode();
528 result = 37 * result + _id.hashCode();
531 result = 37 * result + _user.hashCode();
534 result = 37 * result + _app.hashCode();
536 if (_action != null) {
537 result = 37 * result + _action.hashCode();
540 result = 37 * result + _date.hashCode();
542 if (_propertyList != null) {
543 result = 37 * result + _propertyList.hashCode();
545 if (_paramList != null) {
546 result = 37 * result + _paramList.hashCode();
548 if (_inputList != null) {
549 result = 37 * result + _inputList.hashCode();
558 * @return true if this object is valid according to the schema
560 public boolean isValid(
564 } catch (org.exolab.castor.xml.ValidationException vex) {
574 * @throws org.exolab.castor.xml.MarshalException if object is
575 * null or if any SAXException is thrown during marshaling
576 * @throws org.exolab.castor.xml.ValidationException if this
577 * object is an invalid instance according to the schema
580 final java.io.Writer out)
581 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
582 Marshaller.marshal(this, out);
589 * @throws java.io.IOException if an IOException occurs during
591 * @throws org.exolab.castor.xml.ValidationException if this
592 * object is an invalid instance according to the schema
593 * @throws org.exolab.castor.xml.MarshalException if object is
594 * null or if any SAXException is thrown during marshaling
597 final org.xml.sax.ContentHandler handler)
598 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
599 Marshaller.marshal(this, handler);
604 public void removeAllInput(
606 this._inputList.clear();
611 public void removeAllParam(
613 this._paramList.clear();
618 public void removeAllProperty(
620 this._propertyList.clear();
624 * Method removeInput.
627 * @return true if the object was removed from the collection.
629 public boolean removeInput(
630 final uk.ac.vamsas.objects.core.Input vInput) {
631 boolean removed = _inputList.remove(vInput);
636 * Method removeInputAt.
639 * @return the element removed from the collection
641 public uk.ac.vamsas.objects.core.Input removeInputAt(
643 java.lang.Object obj = this._inputList.remove(index);
644 return (uk.ac.vamsas.objects.core.Input) obj;
648 * Method removeParam.
651 * @return true if the object was removed from the collection.
653 public boolean removeParam(
654 final uk.ac.vamsas.objects.core.Param vParam) {
655 boolean removed = _paramList.remove(vParam);
660 * Method removeParamAt.
663 * @return the element removed from the collection
665 public uk.ac.vamsas.objects.core.Param removeParamAt(
667 java.lang.Object obj = this._paramList.remove(index);
668 return (uk.ac.vamsas.objects.core.Param) obj;
672 * Method removeProperty.
675 * @return true if the object was removed from the collection.
677 public boolean removeProperty(
678 final uk.ac.vamsas.objects.core.Property vProperty) {
679 boolean removed = _propertyList.remove(vProperty);
684 * Method removePropertyAt.
687 * @return the element removed from the collection
689 public uk.ac.vamsas.objects.core.Property removePropertyAt(
691 java.lang.Object obj = this._propertyList.remove(index);
692 return (uk.ac.vamsas.objects.core.Property) obj;
696 * Sets the value of field 'action'. The field 'action' has the
697 * following description: Did what
699 * @param action the value of field 'action'.
701 public void setAction(
702 final java.lang.String action) {
703 this._action = action;
707 * Sets the value of field 'app'. The field 'app' has the
708 * following description: With which application
710 * @param app the value of field 'app'.
713 final java.lang.String app) {
718 * Sets the value of field 'date'. The field 'date' has the
719 * following description: When : TODO: change to dateTime for
722 * @param date the value of field 'date'.
725 final org.exolab.castor.types.Date date) {
730 * Sets the value of field 'id'. The field 'id' has the
731 * following description: Primary Key for vamsas object
735 * @param id the value of field 'id'.
738 final java.lang.String id) {
747 * @throws java.lang.IndexOutOfBoundsException if the index
748 * given is outside the bounds of the collection
750 public void setInput(
752 final uk.ac.vamsas.objects.core.Input vInput)
753 throws java.lang.IndexOutOfBoundsException {
754 // check bounds for index
755 if (index < 0 || index >= this._inputList.size()) {
756 throw new IndexOutOfBoundsException("setInput: Index value '" + index + "' not in range [0.." + (this._inputList.size() - 1) + "]");
759 this._inputList.set(index, vInput);
767 public void setInput(
768 final uk.ac.vamsas.objects.core.Input[] vInputArray) {
772 for (int i = 0; i < vInputArray.length; i++) {
773 this._inputList.add(vInputArray[i]);
778 * Sets the value of '_inputList' by copying the given Vector.
779 * All elements will be checked for type safety.
781 * @param vInputList the Vector to copy.
783 public void setInput(
784 final java.util.Vector vInputList) {
786 this._inputList.clear();
788 this._inputList.addAll(vInputList);
792 * Sets the value of '_inputList' by setting it to the given
793 * Vector. No type checking is performed.
796 * @param inputVector the Vector to set.
798 public void setInputAsReference(
799 final java.util.Vector inputVector) {
800 this._inputList = inputVector;
808 * @throws java.lang.IndexOutOfBoundsException if the index
809 * given is outside the bounds of the collection
811 public void setParam(
813 final uk.ac.vamsas.objects.core.Param vParam)
814 throws java.lang.IndexOutOfBoundsException {
815 // check bounds for index
816 if (index < 0 || index >= this._paramList.size()) {
817 throw new IndexOutOfBoundsException("setParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]");
820 this._paramList.set(index, vParam);
828 public void setParam(
829 final uk.ac.vamsas.objects.core.Param[] vParamArray) {
833 for (int i = 0; i < vParamArray.length; i++) {
834 this._paramList.add(vParamArray[i]);
839 * Sets the value of '_paramList' by copying the given Vector.
840 * All elements will be checked for type safety.
842 * @param vParamList the Vector to copy.
844 public void setParam(
845 final java.util.Vector vParamList) {
847 this._paramList.clear();
849 this._paramList.addAll(vParamList);
853 * Sets the value of '_paramList' by setting it to the given
854 * Vector. No type checking is performed.
857 * @param paramVector the Vector to set.
859 public void setParamAsReference(
860 final java.util.Vector paramVector) {
861 this._paramList = paramVector;
869 * @throws java.lang.IndexOutOfBoundsException if the index
870 * given is outside the bounds of the collection
872 public void setProperty(
874 final uk.ac.vamsas.objects.core.Property vProperty)
875 throws java.lang.IndexOutOfBoundsException {
876 // check bounds for index
877 if (index < 0 || index >= this._propertyList.size()) {
878 throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
881 this._propertyList.set(index, vProperty);
887 * @param vPropertyArray
889 public void setProperty(
890 final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
892 _propertyList.clear();
894 for (int i = 0; i < vPropertyArray.length; i++) {
895 this._propertyList.add(vPropertyArray[i]);
900 * Sets the value of '_propertyList' by copying the given
901 * Vector. All elements will be checked for type safety.
903 * @param vPropertyList the Vector to copy.
905 public void setProperty(
906 final java.util.Vector vPropertyList) {
908 this._propertyList.clear();
910 this._propertyList.addAll(vPropertyList);
914 * Sets the value of '_propertyList' by setting it to the given
915 * Vector. No type checking is performed.
918 * @param propertyVector the Vector to set.
920 public void setPropertyAsReference(
921 final java.util.Vector propertyVector) {
922 this._propertyList = propertyVector;
926 * Sets the value of field 'user'. The field 'user' has the
927 * following description: Who
929 * @param user the value of field 'user'.
932 final java.lang.String user) {
940 * @throws org.exolab.castor.xml.MarshalException if object is
941 * null or if any SAXException is thrown during marshaling
942 * @throws org.exolab.castor.xml.ValidationException if this
943 * object is an invalid instance according to the schema
944 * @return the unmarshaled uk.ac.vamsas.objects.core.Entry
946 public static uk.ac.vamsas.objects.core.Entry unmarshal(
947 final java.io.Reader reader)
948 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
949 return (uk.ac.vamsas.objects.core.Entry) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Entry.class, reader);
955 * @throws org.exolab.castor.xml.ValidationException if this
956 * object is an invalid instance according to the schema
958 public void validate(
960 throws org.exolab.castor.xml.ValidationException {
961 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
962 validator.validate(this);