View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4    * Schema.
5    * $Id: PARAM.java,v 1.14 2007/01/04 16:26:13 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.resource.votable;
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.ArrayList;
19  import java.util.Enumeration;
20  import org.astrogrid.registry.beans.resource.votable.types.DataType;
21  import org.exolab.castor.xml.MarshalException;
22  import org.exolab.castor.xml.Marshaller;
23  import org.exolab.castor.xml.Unmarshaller;
24  import org.exolab.castor.xml.ValidationException;
25  import org.xml.sax.ContentHandler;
26  
27  /***
28   * Class PARAM.
29   * 
30   * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:13 $
31   */
32  public class PARAM extends org.astrogrid.common.bean.BaseBean 
33  implements java.io.Serializable
34  {
35  
36  
37        //--------------------------/
38       //- Class/Member Variables -/
39      //--------------------------/
40  
41      /***
42       * Field _ID
43       */
44      private java.lang.String _ID;
45  
46      /***
47       * Field _unit
48       */
49      private java.lang.String _unit;
50  
51      /***
52       * Field _datatype
53       */
54      private org.astrogrid.registry.beans.resource.votable.types.DataType _datatype;
55  
56      /***
57       * Field _precision
58       */
59      private java.lang.String _precision;
60  
61      /***
62       * Field _width
63       */
64      private int _width;
65  
66      /***
67       * keeps track of state for field: _width
68       */
69      private boolean _has_width;
70  
71      /***
72       * Field _ref
73       */
74      private java.lang.Object _ref;
75  
76      /***
77       * Field _name
78       */
79      private java.lang.String _name;
80  
81      /***
82       * Field _ucd
83       */
84      private java.lang.String _ucd;
85  
86      /***
87       * Field _value
88       */
89      private java.lang.String _value;
90  
91      /***
92       * Field _arraysize
93       */
94      private java.lang.String _arraysize;
95  
96      /***
97       * Field _DESCRIPTION
98       */
99      private org.astrogrid.registry.beans.resource.votable.AnyTEXT _DESCRIPTION;
100 
101     /***
102      * Field _VALUES
103      */
104     private org.astrogrid.registry.beans.resource.votable.VALUES _VALUES;
105 
106     /***
107      * Field _LINKList
108      */
109     private java.util.ArrayList _LINKList;
110 
111 
112       //----------------/
113      //- Constructors -/
114     //----------------/
115 
116     public PARAM() {
117         super();
118         _LINKList = new ArrayList();
119     } //-- org.astrogrid.registry.beans.resource.votable.PARAM()
120 
121 
122       //-----------/
123      //- Methods -/
124     //-----------/
125 
126     /***
127      * Method addLINK
128      * 
129      * @param vLINK
130      */
131     public void addLINK(org.astrogrid.registry.beans.resource.votable.LINK vLINK)
132         throws java.lang.IndexOutOfBoundsException
133     {
134         _LINKList.add(vLINK);
135     } //-- void addLINK(org.astrogrid.registry.beans.resource.votable.LINK) 
136 
137     /***
138      * Method addLINK
139      * 
140      * @param index
141      * @param vLINK
142      */
143     public void addLINK(int index, org.astrogrid.registry.beans.resource.votable.LINK vLINK)
144         throws java.lang.IndexOutOfBoundsException
145     {
146         _LINKList.add(index, vLINK);
147     } //-- void addLINK(int, org.astrogrid.registry.beans.resource.votable.LINK) 
148 
149     /***
150      * Method clearLINK
151      */
152     public void clearLINK()
153     {
154         _LINKList.clear();
155     } //-- void clearLINK() 
156 
157     /***
158      * Method deleteWidth
159      */
160     public void deleteWidth()
161     {
162         this._has_width= false;
163     } //-- void deleteWidth() 
164 
165     /***
166      * Method enumerateLINK
167      */
168     public java.util.Enumeration enumerateLINK()
169     {
170         return new org.exolab.castor.util.IteratorEnumeration(_LINKList.iterator());
171     } //-- java.util.Enumeration enumerateLINK() 
172 
173     /***
174      * Note: hashCode() has not been overriden
175      * 
176      * @param obj
177      */
178     public boolean equals(java.lang.Object obj)
179     {
180         if ( this == obj )
181             return true;
182         
183         if (super.equals(obj)==false)
184             return false;
185         
186         if (obj instanceof PARAM) {
187         
188             PARAM temp = (PARAM)obj;
189             if (this._ID != null) {
190                 if (temp._ID == null) return false;
191                 else if (!(this._ID.equals(temp._ID))) 
192                     return false;
193             }
194             else if (temp._ID != null)
195                 return false;
196             if (this._unit != null) {
197                 if (temp._unit == null) return false;
198                 else if (!(this._unit.equals(temp._unit))) 
199                     return false;
200             }
201             else if (temp._unit != null)
202                 return false;
203             if (this._datatype != null) {
204                 if (temp._datatype == null) return false;
205                 else if (!(this._datatype.equals(temp._datatype))) 
206                     return false;
207             }
208             else if (temp._datatype != null)
209                 return false;
210             if (this._precision != null) {
211                 if (temp._precision == null) return false;
212                 else if (!(this._precision.equals(temp._precision))) 
213                     return false;
214             }
215             else if (temp._precision != null)
216                 return false;
217             if (this._width != temp._width)
218                 return false;
219             if (this._has_width != temp._has_width)
220                 return false;
221             if (this._ref != null) {
222                 if (temp._ref == null) return false;
223                 else if (!(this._ref.equals(temp._ref))) 
224                     return false;
225             }
226             else if (temp._ref != null)
227                 return false;
228             if (this._name != null) {
229                 if (temp._name == null) return false;
230                 else if (!(this._name.equals(temp._name))) 
231                     return false;
232             }
233             else if (temp._name != null)
234                 return false;
235             if (this._ucd != null) {
236                 if (temp._ucd == null) return false;
237                 else if (!(this._ucd.equals(temp._ucd))) 
238                     return false;
239             }
240             else if (temp._ucd != null)
241                 return false;
242             if (this._value != null) {
243                 if (temp._value == null) return false;
244                 else if (!(this._value.equals(temp._value))) 
245                     return false;
246             }
247             else if (temp._value != null)
248                 return false;
249             if (this._arraysize != null) {
250                 if (temp._arraysize == null) return false;
251                 else if (!(this._arraysize.equals(temp._arraysize))) 
252                     return false;
253             }
254             else if (temp._arraysize != null)
255                 return false;
256             if (this._DESCRIPTION != null) {
257                 if (temp._DESCRIPTION == null) return false;
258                 else if (!(this._DESCRIPTION.equals(temp._DESCRIPTION))) 
259                     return false;
260             }
261             else if (temp._DESCRIPTION != null)
262                 return false;
263             if (this._VALUES != null) {
264                 if (temp._VALUES == null) return false;
265                 else if (!(this._VALUES.equals(temp._VALUES))) 
266                     return false;
267             }
268             else if (temp._VALUES != null)
269                 return false;
270             if (this._LINKList != null) {
271                 if (temp._LINKList == null) return false;
272                 else if (!(this._LINKList.equals(temp._LINKList))) 
273                     return false;
274             }
275             else if (temp._LINKList != null)
276                 return false;
277             return true;
278         }
279         return false;
280     } //-- boolean equals(java.lang.Object) 
281 
282     /***
283      * Returns the value of field 'arraysize'.
284      * 
285      * @return the value of field 'arraysize'.
286      */
287     public java.lang.String getArraysize()
288     {
289         return this._arraysize;
290     } //-- java.lang.String getArraysize() 
291 
292     /***
293      * Returns the value of field 'DESCRIPTION'.
294      * 
295      * @return the value of field 'DESCRIPTION'.
296      */
297     public org.astrogrid.registry.beans.resource.votable.AnyTEXT getDESCRIPTION()
298     {
299         return this._DESCRIPTION;
300     } //-- org.astrogrid.registry.beans.resource.votable.AnyTEXT getDESCRIPTION() 
301 
302     /***
303      * Returns the value of field 'datatype'.
304      * 
305      * @return the value of field 'datatype'.
306      */
307     public org.astrogrid.registry.beans.resource.votable.types.DataType getDatatype()
308     {
309         return this._datatype;
310     } //-- org.astrogrid.registry.beans.resource.votable.types.DataType getDatatype() 
311 
312     /***
313      * Returns the value of field 'ID'.
314      * 
315      * @return the value of field 'ID'.
316      */
317     public java.lang.String getID()
318     {
319         return this._ID;
320     } //-- java.lang.String getID() 
321 
322     /***
323      * Method getLINK
324      * 
325      * @param index
326      */
327     public org.astrogrid.registry.beans.resource.votable.LINK getLINK(int index)
328         throws java.lang.IndexOutOfBoundsException
329     {
330         //-- check bounds for index
331         if ((index < 0) || (index > _LINKList.size())) {
332             throw new IndexOutOfBoundsException();
333         }
334         
335         return (org.astrogrid.registry.beans.resource.votable.LINK) _LINKList.get(index);
336     } //-- org.astrogrid.registry.beans.resource.votable.LINK getLINK(int) 
337 
338     /***
339      * Method getLINK
340      */
341     public org.astrogrid.registry.beans.resource.votable.LINK[] getLINK()
342     {
343         int size = _LINKList.size();
344         org.astrogrid.registry.beans.resource.votable.LINK[] mArray = new org.astrogrid.registry.beans.resource.votable.LINK[size];
345         for (int index = 0; index < size; index++) {
346             mArray[index] = (org.astrogrid.registry.beans.resource.votable.LINK) _LINKList.get(index);
347         }
348         return mArray;
349     } //-- org.astrogrid.registry.beans.resource.votable.LINK[] getLINK() 
350 
351     /***
352      * Method getLINKCount
353      */
354     public int getLINKCount()
355     {
356         return _LINKList.size();
357     } //-- int getLINKCount() 
358 
359     /***
360      * Returns the value of field 'name'.
361      * 
362      * @return the value of field 'name'.
363      */
364     public java.lang.String getName()
365     {
366         return this._name;
367     } //-- java.lang.String getName() 
368 
369     /***
370      * Returns the value of field 'precision'.
371      * 
372      * @return the value of field 'precision'.
373      */
374     public java.lang.String getPrecision()
375     {
376         return this._precision;
377     } //-- java.lang.String getPrecision() 
378 
379     /***
380      * Returns the value of field 'ref'.
381      * 
382      * @return the value of field 'ref'.
383      */
384     public java.lang.Object getRef()
385     {
386         return this._ref;
387     } //-- java.lang.Object getRef() 
388 
389     /***
390      * Returns the value of field 'ucd'.
391      * 
392      * @return the value of field 'ucd'.
393      */
394     public java.lang.String getUcd()
395     {
396         return this._ucd;
397     } //-- java.lang.String getUcd() 
398 
399     /***
400      * Returns the value of field 'unit'.
401      * 
402      * @return the value of field 'unit'.
403      */
404     public java.lang.String getUnit()
405     {
406         return this._unit;
407     } //-- java.lang.String getUnit() 
408 
409     /***
410      * Returns the value of field 'VALUES'.
411      * 
412      * @return the value of field 'VALUES'.
413      */
414     public org.astrogrid.registry.beans.resource.votable.VALUES getVALUES()
415     {
416         return this._VALUES;
417     } //-- org.astrogrid.registry.beans.resource.votable.VALUES getVALUES() 
418 
419     /***
420      * Returns the value of field 'value'.
421      * 
422      * @return the value of field 'value'.
423      */
424     public java.lang.String getValue()
425     {
426         return this._value;
427     } //-- java.lang.String getValue() 
428 
429     /***
430      * Returns the value of field 'width'.
431      * 
432      * @return the value of field 'width'.
433      */
434     public int getWidth()
435     {
436         return this._width;
437     } //-- int getWidth() 
438 
439     /***
440      * Method hasWidth
441      */
442     public boolean hasWidth()
443     {
444         return this._has_width;
445     } //-- boolean hasWidth() 
446 
447     /***
448      * Method isValid
449      */
450     public boolean isValid()
451     {
452         try {
453             validate();
454         }
455         catch (org.exolab.castor.xml.ValidationException vex) {
456             return false;
457         }
458         return true;
459     } //-- boolean isValid() 
460 
461     /***
462      * Method marshal
463      * 
464      * @param out
465      */
466     public void marshal(java.io.Writer out)
467         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
468     {
469         
470         Marshaller.marshal(this, out);
471     } //-- void marshal(java.io.Writer) 
472 
473     /***
474      * Method marshal
475      * 
476      * @param handler
477      */
478     public void marshal(org.xml.sax.ContentHandler handler)
479         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
480     {
481         
482         Marshaller.marshal(this, handler);
483     } //-- void marshal(org.xml.sax.ContentHandler) 
484 
485     /***
486      * Method removeLINK
487      * 
488      * @param vLINK
489      */
490     public boolean removeLINK(org.astrogrid.registry.beans.resource.votable.LINK vLINK)
491     {
492         boolean removed = _LINKList.remove(vLINK);
493         return removed;
494     } //-- boolean removeLINK(org.astrogrid.registry.beans.resource.votable.LINK) 
495 
496     /***
497      * Sets the value of field 'arraysize'.
498      * 
499      * @param arraysize the value of field 'arraysize'.
500      */
501     public void setArraysize(java.lang.String arraysize)
502     {
503         this._arraysize = arraysize;
504     } //-- void setArraysize(java.lang.String) 
505 
506     /***
507      * Sets the value of field 'DESCRIPTION'.
508      * 
509      * @param DESCRIPTION the value of field 'DESCRIPTION'.
510      */
511     public void setDESCRIPTION(org.astrogrid.registry.beans.resource.votable.AnyTEXT DESCRIPTION)
512     {
513         this._DESCRIPTION = DESCRIPTION;
514     } //-- void setDESCRIPTION(org.astrogrid.registry.beans.resource.votable.AnyTEXT) 
515 
516     /***
517      * Sets the value of field 'datatype'.
518      * 
519      * @param datatype the value of field 'datatype'.
520      */
521     public void setDatatype(org.astrogrid.registry.beans.resource.votable.types.DataType datatype)
522     {
523         this._datatype = datatype;
524     } //-- void setDatatype(org.astrogrid.registry.beans.resource.votable.types.DataType) 
525 
526     /***
527      * Sets the value of field 'ID'.
528      * 
529      * @param ID the value of field 'ID'.
530      */
531     public void setID(java.lang.String ID)
532     {
533         this._ID = ID;
534     } //-- void setID(java.lang.String) 
535 
536     /***
537      * Method setLINK
538      * 
539      * @param index
540      * @param vLINK
541      */
542     public void setLINK(int index, org.astrogrid.registry.beans.resource.votable.LINK vLINK)
543         throws java.lang.IndexOutOfBoundsException
544     {
545         //-- check bounds for index
546         if ((index < 0) || (index > _LINKList.size())) {
547             throw new IndexOutOfBoundsException();
548         }
549         _LINKList.set(index, vLINK);
550     } //-- void setLINK(int, org.astrogrid.registry.beans.resource.votable.LINK) 
551 
552     /***
553      * Method setLINK
554      * 
555      * @param LINKArray
556      */
557     public void setLINK(org.astrogrid.registry.beans.resource.votable.LINK[] LINKArray)
558     {
559         //-- copy array
560         _LINKList.clear();
561         for (int i = 0; i < LINKArray.length; i++) {
562             _LINKList.add(LINKArray[i]);
563         }
564     } //-- void setLINK(org.astrogrid.registry.beans.resource.votable.LINK) 
565 
566     /***
567      * Sets the value of field 'name'.
568      * 
569      * @param name the value of field 'name'.
570      */
571     public void setName(java.lang.String name)
572     {
573         this._name = name;
574     } //-- void setName(java.lang.String) 
575 
576     /***
577      * Sets the value of field 'precision'.
578      * 
579      * @param precision the value of field 'precision'.
580      */
581     public void setPrecision(java.lang.String precision)
582     {
583         this._precision = precision;
584     } //-- void setPrecision(java.lang.String) 
585 
586     /***
587      * Sets the value of field 'ref'.
588      * 
589      * @param ref the value of field 'ref'.
590      */
591     public void setRef(java.lang.Object ref)
592     {
593         this._ref = ref;
594     } //-- void setRef(java.lang.Object) 
595 
596     /***
597      * Sets the value of field 'ucd'.
598      * 
599      * @param ucd the value of field 'ucd'.
600      */
601     public void setUcd(java.lang.String ucd)
602     {
603         this._ucd = ucd;
604     } //-- void setUcd(java.lang.String) 
605 
606     /***
607      * Sets the value of field 'unit'.
608      * 
609      * @param unit the value of field 'unit'.
610      */
611     public void setUnit(java.lang.String unit)
612     {
613         this._unit = unit;
614     } //-- void setUnit(java.lang.String) 
615 
616     /***
617      * Sets the value of field 'VALUES'.
618      * 
619      * @param VALUES the value of field 'VALUES'.
620      */
621     public void setVALUES(org.astrogrid.registry.beans.resource.votable.VALUES VALUES)
622     {
623         this._VALUES = VALUES;
624     } //-- void setVALUES(org.astrogrid.registry.beans.resource.votable.VALUES) 
625 
626     /***
627      * Sets the value of field 'value'.
628      * 
629      * @param value the value of field 'value'.
630      */
631     public void setValue(java.lang.String value)
632     {
633         this._value = value;
634     } //-- void setValue(java.lang.String) 
635 
636     /***
637      * Sets the value of field 'width'.
638      * 
639      * @param width the value of field 'width'.
640      */
641     public void setWidth(int width)
642     {
643         this._width = width;
644         this._has_width = true;
645     } //-- void setWidth(int) 
646 
647     /***
648      * Method unmarshalPARAM
649      * 
650      * @param reader
651      */
652     public static org.astrogrid.registry.beans.resource.votable.PARAM unmarshalPARAM(java.io.Reader reader)
653         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
654     {
655         return (org.astrogrid.registry.beans.resource.votable.PARAM) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.votable.PARAM.class, reader);
656     } //-- org.astrogrid.registry.beans.resource.votable.PARAM unmarshalPARAM(java.io.Reader) 
657 
658     /***
659      * Method validate
660      */
661     public void validate()
662         throws org.exolab.castor.xml.ValidationException
663     {
664         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
665         validator.validate(this);
666     } //-- void validate() 
667 
668 }