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;
55 private java.util.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
311 * @return the value of field 'Date'.
313 public java.util.Date getDate(
319 * Returns the value of field 'id'. The field 'id' has the
320 * following description: Primary Key for vamsas object
324 * @return the value of field 'Id'.
326 public java.lang.String getId(
335 * @throws java.lang.IndexOutOfBoundsException if the index
336 * given is outside the bounds of the collection
337 * @return the value of the uk.ac.vamsas.objects.core.Input at
340 public uk.ac.vamsas.objects.core.Input getInput(
342 throws java.lang.IndexOutOfBoundsException {
343 // check bounds for index
344 if (index < 0 || index >= this._inputList.size()) {
345 throw new IndexOutOfBoundsException("getInput: Index value '" + index + "' not in range [0.." + (this._inputList.size() - 1) + "]");
348 return (uk.ac.vamsas.objects.core.Input) _inputList.get(index);
352 * Method getInput.Returns the contents of the collection in an
353 * Array. <p>Note: Just in case the collection contents are
354 * changing in another thread, we pass a 0-length Array of the
355 * correct type into the API call. This way we <i>know</i>
356 * that the Array returned is of exactly the correct length.
358 * @return this collection as an Array
360 public uk.ac.vamsas.objects.core.Input[] getInput(
362 uk.ac.vamsas.objects.core.Input[] array = new uk.ac.vamsas.objects.core.Input[0];
363 return (uk.ac.vamsas.objects.core.Input[]) this._inputList.toArray(array);
367 * Method getInputAsReference.Returns a reference to
368 * '_inputList'. No type checking is performed on any
369 * modifications to the Vector.
371 * @return a reference to the Vector backing this class
373 public java.util.Vector getInputAsReference(
375 return this._inputList;
379 * Method getInputCount.
381 * @return the size of this collection
383 public int getInputCount(
385 return this._inputList.size();
392 * @throws java.lang.IndexOutOfBoundsException if the index
393 * given is outside the bounds of the collection
394 * @return the value of the uk.ac.vamsas.objects.core.Param at
397 public uk.ac.vamsas.objects.core.Param getParam(
399 throws java.lang.IndexOutOfBoundsException {
400 // check bounds for index
401 if (index < 0 || index >= this._paramList.size()) {
402 throw new IndexOutOfBoundsException("getParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]");
405 return (uk.ac.vamsas.objects.core.Param) _paramList.get(index);
409 * Method getParam.Returns the contents of the collection in an
410 * Array. <p>Note: Just in case the collection contents are
411 * changing in another thread, we pass a 0-length Array of the
412 * correct type into the API call. This way we <i>know</i>
413 * that the Array returned is of exactly the correct length.
415 * @return this collection as an Array
417 public uk.ac.vamsas.objects.core.Param[] getParam(
419 uk.ac.vamsas.objects.core.Param[] array = new uk.ac.vamsas.objects.core.Param[0];
420 return (uk.ac.vamsas.objects.core.Param[]) this._paramList.toArray(array);
424 * Method getParamAsReference.Returns a reference to
425 * '_paramList'. No type checking is performed on any
426 * modifications to the Vector.
428 * @return a reference to the Vector backing this class
430 public java.util.Vector getParamAsReference(
432 return this._paramList;
436 * Method getParamCount.
438 * @return the size of this collection
440 public int getParamCount(
442 return this._paramList.size();
446 * Method getProperty.
449 * @throws java.lang.IndexOutOfBoundsException if the index
450 * given is outside the bounds of the collection
451 * @return the value of the uk.ac.vamsas.objects.core.Property
454 public uk.ac.vamsas.objects.core.Property getProperty(
456 throws java.lang.IndexOutOfBoundsException {
457 // check bounds for index
458 if (index < 0 || index >= this._propertyList.size()) {
459 throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
462 return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
466 * Method getProperty.Returns the contents of the collection in
467 * an Array. <p>Note: Just in case the collection contents
468 * are changing in another thread, we pass a 0-length Array of
469 * the correct type into the API call. This way we <i>know</i>
470 * that the Array returned is of exactly the correct length.
472 * @return this collection as an Array
474 public uk.ac.vamsas.objects.core.Property[] getProperty(
476 uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
477 return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
481 * Method getPropertyAsReference.Returns a reference to
482 * '_propertyList'. No type checking is performed on any
483 * modifications to the Vector.
485 * @return a reference to the Vector backing this class
487 public java.util.Vector getPropertyAsReference(
489 return this._propertyList;
493 * Method getPropertyCount.
495 * @return the size of this collection
497 public int getPropertyCount(
499 return this._propertyList.size();
503 * Returns the value of field 'user'. The field 'user' has the
504 * following description: Who
506 * @return the value of field 'User'.
508 public java.lang.String getUser(
514 * Overrides the java.lang.Object.hashCode method.
516 * The following steps came from <b>Effective Java Programming
517 * Language Guide</b> by Joshua Bloch, Chapter 3
519 * @return a hash code value for the object.
523 int result = super.hashCode();
527 result = 37 * result + _id.hashCode();
530 result = 37 * result + _user.hashCode();
533 result = 37 * result + _app.hashCode();
535 if (_action != null) {
536 result = 37 * result + _action.hashCode();
539 result = 37 * result + _date.hashCode();
541 if (_propertyList != null) {
542 result = 37 * result + _propertyList.hashCode();
544 if (_paramList != null) {
545 result = 37 * result + _paramList.hashCode();
547 if (_inputList != null) {
548 result = 37 * result + _inputList.hashCode();
557 * @return true if this object is valid according to the schema
559 public boolean isValid(
563 } catch (org.exolab.castor.xml.ValidationException vex) {
573 * @throws org.exolab.castor.xml.MarshalException if object is
574 * null or if any SAXException is thrown during marshaling
575 * @throws org.exolab.castor.xml.ValidationException if this
576 * object is an invalid instance according to the schema
579 final java.io.Writer out)
580 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
581 Marshaller.marshal(this, out);
588 * @throws java.io.IOException if an IOException occurs during
590 * @throws org.exolab.castor.xml.ValidationException if this
591 * object is an invalid instance according to the schema
592 * @throws org.exolab.castor.xml.MarshalException if object is
593 * null or if any SAXException is thrown during marshaling
596 final org.xml.sax.ContentHandler handler)
597 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
598 Marshaller.marshal(this, handler);
603 public void removeAllInput(
605 this._inputList.clear();
610 public void removeAllParam(
612 this._paramList.clear();
617 public void removeAllProperty(
619 this._propertyList.clear();
623 * Method removeInput.
626 * @return true if the object was removed from the collection.
628 public boolean removeInput(
629 final uk.ac.vamsas.objects.core.Input vInput) {
630 boolean removed = _inputList.remove(vInput);
635 * Method removeInputAt.
638 * @return the element removed from the collection
640 public uk.ac.vamsas.objects.core.Input removeInputAt(
642 java.lang.Object obj = this._inputList.remove(index);
643 return (uk.ac.vamsas.objects.core.Input) obj;
647 * Method removeParam.
650 * @return true if the object was removed from the collection.
652 public boolean removeParam(
653 final uk.ac.vamsas.objects.core.Param vParam) {
654 boolean removed = _paramList.remove(vParam);
659 * Method removeParamAt.
662 * @return the element removed from the collection
664 public uk.ac.vamsas.objects.core.Param removeParamAt(
666 java.lang.Object obj = this._paramList.remove(index);
667 return (uk.ac.vamsas.objects.core.Param) obj;
671 * Method removeProperty.
674 * @return true if the object was removed from the collection.
676 public boolean removeProperty(
677 final uk.ac.vamsas.objects.core.Property vProperty) {
678 boolean removed = _propertyList.remove(vProperty);
683 * Method removePropertyAt.
686 * @return the element removed from the collection
688 public uk.ac.vamsas.objects.core.Property removePropertyAt(
690 java.lang.Object obj = this._propertyList.remove(index);
691 return (uk.ac.vamsas.objects.core.Property) obj;
695 * Sets the value of field 'action'. The field 'action' has the
696 * following description: Did what
698 * @param action the value of field 'action'.
700 public void setAction(
701 final java.lang.String action) {
702 this._action = action;
706 * Sets the value of field 'app'. The field 'app' has the
707 * following description: With which application
709 * @param app the value of field 'app'.
712 final java.lang.String app) {
717 * Sets the value of field 'date'. The field 'date' has the
718 * following description: When
720 * @param date the value of field 'date'.
723 final java.util.Date date) {
728 * Sets the value of field 'id'. The field 'id' has the
729 * following description: Primary Key for vamsas object
733 * @param id the value of field 'id'.
736 final java.lang.String id) {
745 * @throws java.lang.IndexOutOfBoundsException if the index
746 * given is outside the bounds of the collection
748 public void setInput(
750 final uk.ac.vamsas.objects.core.Input vInput)
751 throws java.lang.IndexOutOfBoundsException {
752 // check bounds for index
753 if (index < 0 || index >= this._inputList.size()) {
754 throw new IndexOutOfBoundsException("setInput: Index value '" + index + "' not in range [0.." + (this._inputList.size() - 1) + "]");
757 this._inputList.set(index, vInput);
765 public void setInput(
766 final uk.ac.vamsas.objects.core.Input[] vInputArray) {
770 for (int i = 0; i < vInputArray.length; i++) {
771 this._inputList.add(vInputArray[i]);
776 * Sets the value of '_inputList' by copying the given Vector.
777 * All elements will be checked for type safety.
779 * @param vInputList the Vector to copy.
781 public void setInput(
782 final java.util.Vector vInputList) {
784 this._inputList.clear();
786 this._inputList.addAll(vInputList);
790 * Sets the value of '_inputList' by setting it to the given
791 * Vector. No type checking is performed.
794 * @param inputVector the Vector to set.
796 public void setInputAsReference(
797 final java.util.Vector inputVector) {
798 this._inputList = inputVector;
806 * @throws java.lang.IndexOutOfBoundsException if the index
807 * given is outside the bounds of the collection
809 public void setParam(
811 final uk.ac.vamsas.objects.core.Param vParam)
812 throws java.lang.IndexOutOfBoundsException {
813 // check bounds for index
814 if (index < 0 || index >= this._paramList.size()) {
815 throw new IndexOutOfBoundsException("setParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]");
818 this._paramList.set(index, vParam);
826 public void setParam(
827 final uk.ac.vamsas.objects.core.Param[] vParamArray) {
831 for (int i = 0; i < vParamArray.length; i++) {
832 this._paramList.add(vParamArray[i]);
837 * Sets the value of '_paramList' by copying the given Vector.
838 * All elements will be checked for type safety.
840 * @param vParamList the Vector to copy.
842 public void setParam(
843 final java.util.Vector vParamList) {
845 this._paramList.clear();
847 this._paramList.addAll(vParamList);
851 * Sets the value of '_paramList' by setting it to the given
852 * Vector. No type checking is performed.
855 * @param paramVector the Vector to set.
857 public void setParamAsReference(
858 final java.util.Vector paramVector) {
859 this._paramList = paramVector;
867 * @throws java.lang.IndexOutOfBoundsException if the index
868 * given is outside the bounds of the collection
870 public void setProperty(
872 final uk.ac.vamsas.objects.core.Property vProperty)
873 throws java.lang.IndexOutOfBoundsException {
874 // check bounds for index
875 if (index < 0 || index >= this._propertyList.size()) {
876 throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
879 this._propertyList.set(index, vProperty);
885 * @param vPropertyArray
887 public void setProperty(
888 final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
890 _propertyList.clear();
892 for (int i = 0; i < vPropertyArray.length; i++) {
893 this._propertyList.add(vPropertyArray[i]);
898 * Sets the value of '_propertyList' by copying the given
899 * Vector. All elements will be checked for type safety.
901 * @param vPropertyList the Vector to copy.
903 public void setProperty(
904 final java.util.Vector vPropertyList) {
906 this._propertyList.clear();
908 this._propertyList.addAll(vPropertyList);
912 * Sets the value of '_propertyList' by setting it to the given
913 * Vector. No type checking is performed.
916 * @param propertyVector the Vector to set.
918 public void setPropertyAsReference(
919 final java.util.Vector propertyVector) {
920 this._propertyList = propertyVector;
924 * Sets the value of field 'user'. The field 'user' has the
925 * following description: Who
927 * @param user the value of field 'user'.
930 final java.lang.String user) {
938 * @throws org.exolab.castor.xml.MarshalException if object is
939 * null or if any SAXException is thrown during marshaling
940 * @throws org.exolab.castor.xml.ValidationException if this
941 * object is an invalid instance according to the schema
942 * @return the unmarshaled uk.ac.vamsas.objects.core.Entry
944 public static uk.ac.vamsas.objects.core.Entry unmarshal(
945 final java.io.Reader reader)
946 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
947 return (uk.ac.vamsas.objects.core.Entry) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Entry.class, reader);
953 * @throws org.exolab.castor.xml.ValidationException if this
954 * object is an invalid instance according to the schema
956 public void validate(
958 throws org.exolab.castor.xml.ValidationException {
959 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
960 validator.validate(this);