refactored org to uk
[vamsas.git] / src / org / vamsas / objects / core / Entry.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
4  * Schema.
5  * $Id:Entry.java 264 2006-12-14 17:42:54Z JimP $
6  */
7
8 package org.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
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;
25
26 /**
27  * Class Entry.
28  * 
29  * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $
30  */
31 public class Entry extends uk.ac.vamsas.client.Vobject 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Primary Key for vamsas object referencing
42      *  
43      */
44     private java.lang.String _id;
45
46     /**
47      * Who 
48      */
49     private java.lang.String _user;
50
51     /**
52      * With which application 
53      */
54     private java.lang.String _app;
55
56     /**
57      * Did what 
58      */
59     private java.lang.String _action;
60
61     /**
62      * When 
63      */
64     private org.exolab.castor.types.Date _date;
65
66     /**
67      * additional information 
68      */
69     private java.util.Vector _propertyList;
70
71     /**
72      * parameter for the action 
73      */
74     private java.util.Vector _paramList;
75
76     /**
77      * bioinformatic objects input to action
78      *  
79      */
80     private java.util.Vector _inputList;
81
82
83       //----------------/
84      //- Constructors -/
85     //----------------/
86
87     public Entry() 
88      {
89         super();
90         _propertyList = new Vector();
91         _paramList = new Vector();
92         _inputList = new Vector();
93     } //-- org.vamsas.objects.core.Entry()
94
95
96       //-----------/
97      //- Methods -/
98     //-----------/
99
100     /**
101      * Method addInput
102      * 
103      * 
104      * 
105      * @param vInput
106      */
107     public void addInput(org.vamsas.objects.core.Input vInput)
108         throws java.lang.IndexOutOfBoundsException
109     {
110         _inputList.addElement(vInput);
111     } //-- void addInput(org.vamsas.objects.core.Input) 
112
113     /**
114      * Method addInput
115      * 
116      * 
117      * 
118      * @param index
119      * @param vInput
120      */
121     public void addInput(int index, org.vamsas.objects.core.Input vInput)
122         throws java.lang.IndexOutOfBoundsException
123     {
124         _inputList.insertElementAt(vInput, index);
125     } //-- void addInput(int, org.vamsas.objects.core.Input) 
126
127     /**
128      * Method addParam
129      * 
130      * 
131      * 
132      * @param vParam
133      */
134     public void addParam(org.vamsas.objects.core.Param vParam)
135         throws java.lang.IndexOutOfBoundsException
136     {
137         _paramList.addElement(vParam);
138     } //-- void addParam(org.vamsas.objects.core.Param) 
139
140     /**
141      * Method addParam
142      * 
143      * 
144      * 
145      * @param index
146      * @param vParam
147      */
148     public void addParam(int index, org.vamsas.objects.core.Param vParam)
149         throws java.lang.IndexOutOfBoundsException
150     {
151         _paramList.insertElementAt(vParam, index);
152     } //-- void addParam(int, org.vamsas.objects.core.Param) 
153
154     /**
155      * Method addProperty
156      * 
157      * 
158      * 
159      * @param vProperty
160      */
161     public void addProperty(org.vamsas.objects.core.Property vProperty)
162         throws java.lang.IndexOutOfBoundsException
163     {
164         _propertyList.addElement(vProperty);
165     } //-- void addProperty(org.vamsas.objects.core.Property) 
166
167     /**
168      * Method addProperty
169      * 
170      * 
171      * 
172      * @param index
173      * @param vProperty
174      */
175     public void addProperty(int index, org.vamsas.objects.core.Property vProperty)
176         throws java.lang.IndexOutOfBoundsException
177     {
178         _propertyList.insertElementAt(vProperty, index);
179     } //-- void addProperty(int, org.vamsas.objects.core.Property) 
180
181     /**
182      * Method enumerateInput
183      * 
184      * 
185      * 
186      * @return Enumeration
187      */
188     public java.util.Enumeration enumerateInput()
189     {
190         return _inputList.elements();
191     } //-- java.util.Enumeration enumerateInput() 
192
193     /**
194      * Method enumerateParam
195      * 
196      * 
197      * 
198      * @return Enumeration
199      */
200     public java.util.Enumeration enumerateParam()
201     {
202         return _paramList.elements();
203     } //-- java.util.Enumeration enumerateParam() 
204
205     /**
206      * Method enumerateProperty
207      * 
208      * 
209      * 
210      * @return Enumeration
211      */
212     public java.util.Enumeration enumerateProperty()
213     {
214         return _propertyList.elements();
215     } //-- java.util.Enumeration enumerateProperty() 
216
217     /**
218      * Note: hashCode() has not been overriden
219      * 
220      * @param obj
221      * @return boolean
222      */
223     public boolean equals(java.lang.Object obj)
224     {
225         if ( this == obj )
226             return true;
227         
228         if (super.equals(obj)==false)
229             return false;
230         
231         if (obj instanceof Entry) {
232         
233             Entry temp = (Entry)obj;
234             if (this._id != null) {
235                 if (temp._id == null) return false;
236                 else if (!(this._id.equals(temp._id))) 
237                     return false;
238             }
239             else if (temp._id != null)
240                 return false;
241             if (this._user != null) {
242                 if (temp._user == null) return false;
243                 else if (!(this._user.equals(temp._user))) 
244                     return false;
245             }
246             else if (temp._user != null)
247                 return false;
248             if (this._app != null) {
249                 if (temp._app == null) return false;
250                 else if (!(this._app.equals(temp._app))) 
251                     return false;
252             }
253             else if (temp._app != null)
254                 return false;
255             if (this._action != null) {
256                 if (temp._action == null) return false;
257                 else if (!(this._action.equals(temp._action))) 
258                     return false;
259             }
260             else if (temp._action != null)
261                 return false;
262             if (this._date != null) {
263                 if (temp._date == null) return false;
264                 else if (!(this._date.equals(temp._date))) 
265                     return false;
266             }
267             else if (temp._date != null)
268                 return false;
269             if (this._propertyList != null) {
270                 if (temp._propertyList == null) return false;
271                 else if (!(this._propertyList.equals(temp._propertyList))) 
272                     return false;
273             }
274             else if (temp._propertyList != null)
275                 return false;
276             if (this._paramList != null) {
277                 if (temp._paramList == null) return false;
278                 else if (!(this._paramList.equals(temp._paramList))) 
279                     return false;
280             }
281             else if (temp._paramList != null)
282                 return false;
283             if (this._inputList != null) {
284                 if (temp._inputList == null) return false;
285                 else if (!(this._inputList.equals(temp._inputList))) 
286                     return false;
287             }
288             else if (temp._inputList != null)
289                 return false;
290             return true;
291         }
292         return false;
293     } //-- boolean equals(java.lang.Object) 
294
295     /**
296      * Returns the value of field 'action'. The field 'action' has
297      * the following description: Did what 
298      * 
299      * @return String
300      * @return the value of field 'action'.
301      */
302     public java.lang.String getAction()
303     {
304         return this._action;
305     } //-- java.lang.String getAction() 
306
307     /**
308      * Returns the value of field 'app'. The field 'app' has the
309      * following description: With which application 
310      * 
311      * @return String
312      * @return the value of field 'app'.
313      */
314     public java.lang.String getApp()
315     {
316         return this._app;
317     } //-- java.lang.String getApp() 
318
319     /**
320      * Returns the value of field 'date'. The field 'date' has the
321      * following description: When 
322      * 
323      * @return Date
324      * @return the value of field 'date'.
325      */
326     public org.exolab.castor.types.Date getDate()
327     {
328         return this._date;
329     } //-- org.exolab.castor.types.Date getDate() 
330
331     /**
332      * Returns the value of field 'id'. The field 'id' has the
333      * following description: Primary Key for vamsas object
334      * referencing
335      *  
336      * 
337      * @return String
338      * @return the value of field 'id'.
339      */
340     public java.lang.String getId()
341     {
342         return this._id;
343     } //-- java.lang.String getId() 
344
345     /**
346      * Method getInput
347      * 
348      * 
349      * 
350      * @param index
351      * @return Input
352      */
353     public org.vamsas.objects.core.Input getInput(int index)
354         throws java.lang.IndexOutOfBoundsException
355     {
356         //-- check bounds for index
357         if ((index < 0) || (index > _inputList.size())) {
358             throw new IndexOutOfBoundsException("getInput: Index value '"+index+"' not in range [0.."+_inputList.size()+ "]");
359         }
360         
361         return (org.vamsas.objects.core.Input) _inputList.elementAt(index);
362     } //-- org.vamsas.objects.core.Input getInput(int) 
363
364     /**
365      * Method getInput
366      * 
367      * 
368      * 
369      * @return Input
370      */
371     public org.vamsas.objects.core.Input[] getInput()
372     {
373         int size = _inputList.size();
374         org.vamsas.objects.core.Input[] mArray = new org.vamsas.objects.core.Input[size];
375         for (int index = 0; index < size; index++) {
376             mArray[index] = (org.vamsas.objects.core.Input) _inputList.elementAt(index);
377         }
378         return mArray;
379     } //-- org.vamsas.objects.core.Input[] getInput() 
380
381     /**
382      * Method getInputCount
383      * 
384      * 
385      * 
386      * @return int
387      */
388     public int getInputCount()
389     {
390         return _inputList.size();
391     } //-- int getInputCount() 
392
393     /**
394      * Method getParam
395      * 
396      * 
397      * 
398      * @param index
399      * @return Param
400      */
401     public org.vamsas.objects.core.Param getParam(int index)
402         throws java.lang.IndexOutOfBoundsException
403     {
404         //-- check bounds for index
405         if ((index < 0) || (index > _paramList.size())) {
406             throw new IndexOutOfBoundsException("getParam: Index value '"+index+"' not in range [0.."+_paramList.size()+ "]");
407         }
408         
409         return (org.vamsas.objects.core.Param) _paramList.elementAt(index);
410     } //-- org.vamsas.objects.core.Param getParam(int) 
411
412     /**
413      * Method getParam
414      * 
415      * 
416      * 
417      * @return Param
418      */
419     public org.vamsas.objects.core.Param[] getParam()
420     {
421         int size = _paramList.size();
422         org.vamsas.objects.core.Param[] mArray = new org.vamsas.objects.core.Param[size];
423         for (int index = 0; index < size; index++) {
424             mArray[index] = (org.vamsas.objects.core.Param) _paramList.elementAt(index);
425         }
426         return mArray;
427     } //-- org.vamsas.objects.core.Param[] getParam() 
428
429     /**
430      * Method getParamCount
431      * 
432      * 
433      * 
434      * @return int
435      */
436     public int getParamCount()
437     {
438         return _paramList.size();
439     } //-- int getParamCount() 
440
441     /**
442      * Method getProperty
443      * 
444      * 
445      * 
446      * @param index
447      * @return Property
448      */
449     public org.vamsas.objects.core.Property getProperty(int index)
450         throws java.lang.IndexOutOfBoundsException
451     {
452         //-- check bounds for index
453         if ((index < 0) || (index > _propertyList.size())) {
454             throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
455         }
456         
457         return (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
458     } //-- org.vamsas.objects.core.Property getProperty(int) 
459
460     /**
461      * Method getProperty
462      * 
463      * 
464      * 
465      * @return Property
466      */
467     public org.vamsas.objects.core.Property[] getProperty()
468     {
469         int size = _propertyList.size();
470         org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size];
471         for (int index = 0; index < size; index++) {
472             mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index);
473         }
474         return mArray;
475     } //-- org.vamsas.objects.core.Property[] getProperty() 
476
477     /**
478      * Method getPropertyCount
479      * 
480      * 
481      * 
482      * @return int
483      */
484     public int getPropertyCount()
485     {
486         return _propertyList.size();
487     } //-- int getPropertyCount() 
488
489     /**
490      * Returns the value of field 'user'. The field 'user' has the
491      * following description: Who 
492      * 
493      * @return String
494      * @return the value of field 'user'.
495      */
496     public java.lang.String getUser()
497     {
498         return this._user;
499     } //-- java.lang.String getUser() 
500
501     /**
502      * Method isValid
503      * 
504      * 
505      * 
506      * @return boolean
507      */
508     public boolean isValid()
509     {
510         try {
511             validate();
512         }
513         catch (org.exolab.castor.xml.ValidationException vex) {
514             return false;
515         }
516         return true;
517     } //-- boolean isValid() 
518
519     /**
520      * Method marshal
521      * 
522      * 
523      * 
524      * @param out
525      */
526     public void marshal(java.io.Writer out)
527         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
528     {
529         
530         Marshaller.marshal(this, out);
531     } //-- void marshal(java.io.Writer) 
532
533     /**
534      * Method marshal
535      * 
536      * 
537      * 
538      * @param handler
539      */
540     public void marshal(org.xml.sax.ContentHandler handler)
541         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
542     {
543         
544         Marshaller.marshal(this, handler);
545     } //-- void marshal(org.xml.sax.ContentHandler) 
546
547     /**
548      * Method removeAllInput
549      * 
550      */
551     public void removeAllInput()
552     {
553         _inputList.removeAllElements();
554     } //-- void removeAllInput() 
555
556     /**
557      * Method removeAllParam
558      * 
559      */
560     public void removeAllParam()
561     {
562         _paramList.removeAllElements();
563     } //-- void removeAllParam() 
564
565     /**
566      * Method removeAllProperty
567      * 
568      */
569     public void removeAllProperty()
570     {
571         _propertyList.removeAllElements();
572     } //-- void removeAllProperty() 
573
574     /**
575      * Method removeInput
576      * 
577      * 
578      * 
579      * @param index
580      * @return Input
581      */
582     public org.vamsas.objects.core.Input removeInput(int index)
583     {
584         java.lang.Object obj = _inputList.elementAt(index);
585         _inputList.removeElementAt(index);
586         return (org.vamsas.objects.core.Input) obj;
587     } //-- org.vamsas.objects.core.Input removeInput(int) 
588
589     /**
590      * Method removeParam
591      * 
592      * 
593      * 
594      * @param index
595      * @return Param
596      */
597     public org.vamsas.objects.core.Param removeParam(int index)
598     {
599         java.lang.Object obj = _paramList.elementAt(index);
600         _paramList.removeElementAt(index);
601         return (org.vamsas.objects.core.Param) obj;
602     } //-- org.vamsas.objects.core.Param removeParam(int) 
603
604     /**
605      * Method removeProperty
606      * 
607      * 
608      * 
609      * @param index
610      * @return Property
611      */
612     public org.vamsas.objects.core.Property removeProperty(int index)
613     {
614         java.lang.Object obj = _propertyList.elementAt(index);
615         _propertyList.removeElementAt(index);
616         return (org.vamsas.objects.core.Property) obj;
617     } //-- org.vamsas.objects.core.Property removeProperty(int) 
618
619     /**
620      * Sets the value of field 'action'. The field 'action' has the
621      * following description: Did what 
622      * 
623      * @param action the value of field 'action'.
624      */
625     public void setAction(java.lang.String action)
626     {
627         this._action = action;
628     } //-- void setAction(java.lang.String) 
629
630     /**
631      * Sets the value of field 'app'. The field 'app' has the
632      * following description: With which application 
633      * 
634      * @param app the value of field 'app'.
635      */
636     public void setApp(java.lang.String app)
637     {
638         this._app = app;
639     } //-- void setApp(java.lang.String) 
640
641     /**
642      * Sets the value of field 'date'. The field 'date' has the
643      * following description: When 
644      * 
645      * @param date the value of field 'date'.
646      */
647     public void setDate(org.exolab.castor.types.Date date)
648     {
649         this._date = date;
650     } //-- void setDate(org.exolab.castor.types.Date) 
651
652     /**
653      * Sets the value of field 'id'. The field 'id' has the
654      * following description: Primary Key for vamsas object
655      * referencing
656      *  
657      * 
658      * @param id the value of field 'id'.
659      */
660     public void setId(java.lang.String id)
661     {
662         this._id = id;
663     } //-- void setId(java.lang.String) 
664
665     /**
666      * Method setInput
667      * 
668      * 
669      * 
670      * @param index
671      * @param vInput
672      */
673     public void setInput(int index, org.vamsas.objects.core.Input vInput)
674         throws java.lang.IndexOutOfBoundsException
675     {
676         //-- check bounds for index
677         if ((index < 0) || (index > _inputList.size())) {
678             throw new IndexOutOfBoundsException("setInput: Index value '"+index+"' not in range [0.."+_inputList.size()+ "]");
679         }
680         _inputList.setElementAt(vInput, index);
681     } //-- void setInput(int, org.vamsas.objects.core.Input) 
682
683     /**
684      * Method setInput
685      * 
686      * 
687      * 
688      * @param inputArray
689      */
690     public void setInput(org.vamsas.objects.core.Input[] inputArray)
691     {
692         //-- copy array
693         _inputList.removeAllElements();
694         for (int i = 0; i < inputArray.length; i++) {
695             _inputList.addElement(inputArray[i]);
696         }
697     } //-- void setInput(org.vamsas.objects.core.Input) 
698
699     /**
700      * Method setParam
701      * 
702      * 
703      * 
704      * @param index
705      * @param vParam
706      */
707     public void setParam(int index, org.vamsas.objects.core.Param vParam)
708         throws java.lang.IndexOutOfBoundsException
709     {
710         //-- check bounds for index
711         if ((index < 0) || (index > _paramList.size())) {
712             throw new IndexOutOfBoundsException("setParam: Index value '"+index+"' not in range [0.."+_paramList.size()+ "]");
713         }
714         _paramList.setElementAt(vParam, index);
715     } //-- void setParam(int, org.vamsas.objects.core.Param) 
716
717     /**
718      * Method setParam
719      * 
720      * 
721      * 
722      * @param paramArray
723      */
724     public void setParam(org.vamsas.objects.core.Param[] paramArray)
725     {
726         //-- copy array
727         _paramList.removeAllElements();
728         for (int i = 0; i < paramArray.length; i++) {
729             _paramList.addElement(paramArray[i]);
730         }
731     } //-- void setParam(org.vamsas.objects.core.Param) 
732
733     /**
734      * Method setProperty
735      * 
736      * 
737      * 
738      * @param index
739      * @param vProperty
740      */
741     public void setProperty(int index, org.vamsas.objects.core.Property vProperty)
742         throws java.lang.IndexOutOfBoundsException
743     {
744         //-- check bounds for index
745         if ((index < 0) || (index > _propertyList.size())) {
746             throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]");
747         }
748         _propertyList.setElementAt(vProperty, index);
749     } //-- void setProperty(int, org.vamsas.objects.core.Property) 
750
751     /**
752      * Method setProperty
753      * 
754      * 
755      * 
756      * @param propertyArray
757      */
758     public void setProperty(org.vamsas.objects.core.Property[] propertyArray)
759     {
760         //-- copy array
761         _propertyList.removeAllElements();
762         for (int i = 0; i < propertyArray.length; i++) {
763             _propertyList.addElement(propertyArray[i]);
764         }
765     } //-- void setProperty(org.vamsas.objects.core.Property) 
766
767     /**
768      * Sets the value of field 'user'. The field 'user' has the
769      * following description: Who 
770      * 
771      * @param user the value of field 'user'.
772      */
773     public void setUser(java.lang.String user)
774     {
775         this._user = user;
776     } //-- void setUser(java.lang.String) 
777
778     /**
779      * Method unmarshal
780      * 
781      * 
782      * 
783      * @param reader
784      * @return Entry
785      */
786     public static org.vamsas.objects.core.Entry unmarshal(java.io.Reader reader)
787         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
788     {
789         return (org.vamsas.objects.core.Entry) Unmarshaller.unmarshal(org.vamsas.objects.core.Entry.class, reader);
790     } //-- org.vamsas.objects.core.Entry unmarshal(java.io.Reader) 
791
792     /**
793      * Method validate
794      * 
795      */
796     public void validate()
797         throws org.exolab.castor.xml.ValidationException
798     {
799         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
800         validator.validate(this);
801     } //-- void validate() 
802
803 }