Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/biomage/Array/Array_package.java


1   /***************************************************************************  
2    *                                                                         *
3    * C O P Y R I G H T   N O T I C E                                         * 
4    *  Copyright (c) 2001 by:                                                 *
5    *    * The MicroArray Gene Expression Database group (MGED)               *
6    *    * Rosetta Inpharmatics                                               *
7    *                                                                         *
8    *    All Rights Reserved.                                                 *
9    *                                                                         *
10   * Permission is hereby granted, free of charge, to any person             *
11   * obtaining a copy of this software and associated documentation files    *
12   * (the "Software"), to deal in the Software without restriction,          *
13   * including without limitation the rights to use, copy, modify, merge,    *
14   * publish, distribute, sublicense, and/or sell copies of the Software,    *
15   * and to permit persons to whom the Software is furnished to do so,       *
16   * subject to the following conditions:                                    *
17   *                                                                         *
18   * The above copyright notice and this permission notice shall be          *
19   * included in all copies or substantial portions of the Software.         *
20   *                                                                         *
21   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,         *
22   * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF      * 
23   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND                   *
24   * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS     *
25   * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN      *
26   * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN       *
27   * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE        *
28   * SOFTWARE.                                                               *
29   ***************************************************************************
30   *                                                                         *
31   * Created by the create_mage_java_classes java program based on the       * 
32   * information in the xmi file created from the MAGE-OM UML model,         *
33   * copyright European Bioinformatics Institute (EBI) for MGED and Rosetta  *
34   * Informatics.                                                            *
35   *                                                                         *
36   * The ideas and work are built on the previous work in perl of Jason      *
37   * Stewart, Open Informatics, and Robert M. Hubley, Institute for Systems  *
38   * Biology                                                                 *
39   *                                                                         *
40   * @author  Michael Miller, Rosetta Inpharmatics                           *
41   * @version Revision: 1.0                                                  *
42   * @date    Thu, Feb 21, 2002 10:46:50 AM                                  *
43   *                                                                         *
44   ***************************************************************************
45   */
46  
47  /**
48   *  org.biomage.Array
49   *  
50   */
51  package org.biomage.Array;
52  
53  /**
54   *  Import list for Array_package
55   *  
56   */
57  import java.io.Serializable;
58  import java.util.*;
59  import org.xml.sax.Attributes;
60  import java.io.Writer;
61  import java.io.IOException;
62  
63  /**
64   *  Describes the process of creating arrays from array designs.  
65   *  Includes information on how arrays are grouped together, if relevant, 
66   *  how an array deviates from its array design both in layout and per 
67   *  feature and potentially contains references to LIMS data that might 
68   *  contain more detail on the BioMaterial used to create the reporters.
69   *  
70   */
71  public
72  class Array_package
73      implements Serializable
74  {
75      /**
76       *  Inner list class for holding multiple entries for attribute 
77       *  array_list.  Simply creates a named vector.
78       *  
79       */
80      public
81      class
82      Array_list extends Vector
83      {
84      }
85  
86      /**
87       *  The physical substrate along with its features and their 
88       *  annotation
89       *  
90       */
91      public Array_list array_list = new Array_list();
92  
93      /**
94       *  Inner list class for holding multiple entries for attribute 
95       *  arrayGroup_list.  Simply creates a named vector.
96       *  
97       */
98      public
99      class
100     ArrayGroup_list extends Vector
101     {
102     }
103 
104     /**
105      *  An array package is a physical platform that contains one or more 
106      *  arrays that are separately addressable (e.g. several arrays that can 
107      *  be hybridized on a single microscope slide) or a virtual grouping 
108      *  together of arrays.
109      *  
110      *  The array package that has been manufactured has information about 
111      *  where certain artifacts about the array are located for scanning and 
112      *  feature extraction purposes.
113      *  
114      */
115     public ArrayGroup_list arrayGroup_list = new ArrayGroup_list();
116 
117     /**
118      *  Inner list class for holding multiple entries for attribute 
119      *  arrayManufacture_list.  Simply creates a named vector.
120      *  
121      */
122     public
123     class
124     ArrayManufacture_list extends Vector
125     {
126     }
127 
128     /**
129      *  Describes the process by which arrays are produced.
130      *  
131      */
132     public ArrayManufacture_list arrayManufacture_list = new ArrayManufacture_list();
133 
134     /**
135      *  Default constructor.
136      *  
137      */
138     public
139     Array_package()
140     {
141     }
142 
143     /**
144      *  Attribute constructor.
145      *  
146      *  Looks up the attributes in the parameter and casts them from strings 
147      *  appropriately
148      *  @param atts: the attribute list.
149      *  
150      */
151     // TODO Work in progress (attribute constructor).
152     public
153     Array_package(Attributes atts)
154     {
155     }
156 
157     /**
158      *  writeMAGEML
159      *  <p>
160      *  This method is responsible for assembling the attribute and 
161      *  association data into XML. It creates the object tag and then calls 
162      *  the writeAttributes and writeAssociation methods.
163      *  <p>
164      *  
165      */
166     public
167     void
168     writeMAGEML(Writer out)
169     throws IOException
170     {
171         out.write("<Array_package");
172         writeAttributes(out);
173         out.write(">");
174         writeAssociations(out);
175         out.write("</Array_package>");
176     }
177 
178     /**
179      *  writeAttributes
180      *  <p>
181      *  This method is responsible for assembling the attribute data into 
182      *  XML. It calls the super method to write out all attributes of this 
183      *  class and it's ancestors.
184      *  <p>
185      *  
186      */
187     public
188     void
189     writeAttributes(Writer out)
190     throws IOException
191     {
192     }
193 
194     /**
195      *  writeAssociations
196      *  <p>
197      *  This method is responsible for assembling the association data 
198      *  into XML. It calls the super method to write out all associations of 
199      *  this class's ancestors.
200      *  <p>
201      *  
202      */
203     public
204     void
205     writeAssociations(Writer out)
206     throws IOException
207     {
208         if ( arrayManufacture_list.size() > 0 ){
209             out.write("<ArrayManufacture_assnlist>");
210             for ( int i = 0; i < arrayManufacture_list.size(); i++) {
211                 ((ArrayManufacture)arrayManufacture_list.elementAt(i)).writeMAGEML(out);
212             }
213             out.write("</ArrayManufacture_assnlist>");
214         }
215         if ( arrayGroup_list.size() > 0 ){
216             out.write("<ArrayGroup_assnlist>");
217             for ( int i = 0; i < arrayGroup_list.size(); i++) {
218                 ((ArrayGroup)arrayGroup_list.elementAt(i)).writeMAGEML(out);
219             }
220             out.write("</ArrayGroup_assnlist>");
221         }
222         if ( array_list.size() > 0 ){
223             out.write("<Array_assnlist>");
224             for ( int i = 0; i < array_list.size(); i++) {
225                 ((Array)array_list.elementAt(i)).writeMAGEML(out);
226             }
227             out.write("</Array_assnlist>");
228         }
229     }
230 
231     /**
232      *  Set method for array_list
233      *  <p>
234      *  @param value to set
235      *  <p>
236      *  
237      */
238     public
239     void
240     setArray_list(
241         Array_list array_list
242     )
243     {
244         ((List)this.array_list).addAll((List)array_list);
245     }
246 
247     /**
248      *  Get method for array_list
249      *  <p>
250      *  @return value of the attribute
251      *  <p>
252      *  
253      */
254     public
255     Array_list
256     getArray_list()
257     {
258         return array_list;
259     }
260 
261     /**
262      *  Method to add Array to Array_list
263      *  
264      */
265     public
266     void
267     addToArray_list(
268         Array array
269     )
270     {
271         this.array_list.add(array);
272     }
273 
274     /**
275      *  Method to add Array at position to Array_list
276      *  
277      */
278     public
279     void
280     addToArray_list(
281         int position,
282         Array array
283     )
284     {
285         this.array_list.add(position, array);
286     }
287 
288     /**
289      *  Method to get Array from Array_list
290      *  
291      */
292     public
293     Array
294     getFromArray_list(
295         int position
296     )
297     {
298         return (Array) this.array_list.get(position);
299     }
300 
301     /**
302      *  Method to remove by position from Array_list
303      *  
304      */
305     public
306     void
307     removeElementAtFromArray_list(
308         int position
309     )
310     {
311         this.array_list.removeElementAt(position);
312     }
313 
314     /**
315      *  Method to remove first Array from Array_list
316      *  
317      */
318     public
319     void
320     removeFromArray_list(
321         Array array
322     )
323     {
324         this.array_list.remove(array);
325     }
326 
327     /**
328      *  Set method for arrayGroup_list
329      *  <p>
330      *  @param value to set
331      *  <p>
332      *  
333      */
334     public
335     void
336     setArrayGroup_list(
337         ArrayGroup_list arrayGroup_list
338     )
339     {
340         ((List)this.arrayGroup_list).addAll((List)arrayGroup_list);
341     }
342 
343     /**
344      *  Get method for arrayGroup_list
345      *  <p>
346      *  @return value of the attribute
347      *  <p>
348      *  
349      */
350     public
351     ArrayGroup_list
352     getArrayGroup_list()
353     {
354         return arrayGroup_list;
355     }
356 
357     /**
358      *  Method to add ArrayGroup to ArrayGroup_list
359      *  
360      */
361     public
362     void
363     addToArrayGroup_list(
364         ArrayGroup arrayGroup
365     )
366     {
367         this.arrayGroup_list.add(arrayGroup);
368     }
369 
370     /**
371      *  Method to add ArrayGroup at position to ArrayGroup_list
372      *  
373      */
374     public
375     void
376     addToArrayGroup_list(
377         int position,
378         ArrayGroup arrayGroup
379     )
380     {
381         this.arrayGroup_list.add(position, arrayGroup);
382     }
383 
384     /**
385      *  Method to get ArrayGroup from ArrayGroup_list
386      *  
387      */
388     public
389     ArrayGroup
390     getFromArrayGroup_list(
391         int position
392     )
393     {
394         return (ArrayGroup) this.arrayGroup_list.get(position);
395     }
396 
397     /**
398      *  Method to remove by position from ArrayGroup_list
399      *  
400      */
401     public
402     void
403     removeElementAtFromArrayGroup_list(
404         int position
405     )
406     {
407         this.arrayGroup_list.removeElementAt(position);
408     }
409 
410     /**
411      *  Method to remove first ArrayGroup from ArrayGroup_list
412      *  
413      */
414     public
415     void
416     removeFromArrayGroup_list(
417         ArrayGroup arrayGroup
418     )
419     {
420         this.arrayGroup_list.remove(arrayGroup);
421     }
422 
423     /**
424      *  Set method for arrayManufacture_list
425      *  <p>
426      *  @param value to set
427      *  <p>
428      *  
429      */
430     public
431     void
432     setArrayManufacture_list(
433         ArrayManufacture_list arrayManufacture_list
434     )
435     {
436         ((List)this.arrayManufacture_list).addAll((List)arrayManufacture_list);
437     }
438 
439     /**
440      *  Get method for arrayManufacture_list
441      *  <p>
442      *  @return value of the attribute
443      *  <p>
444      *  
445      */
446     public
447     ArrayManufacture_list
448     getArrayManufacture_list()
449     {
450         return arrayManufacture_list;
451     }
452 
453     /**
454      *  Method to add ArrayManufacture to ArrayManufacture_list
455      *  
456      */
457     public
458     void
459     addToArrayManufacture_list(
460         ArrayManufacture arrayManufacture
461     )
462     {
463         this.arrayManufacture_list.add(arrayManufacture);
464     }
465 
466     /**
467      *  Method to add ArrayManufacture at position to 
468      *  ArrayManufacture_list
469      *  
470      */
471     public
472     void
473     addToArrayManufacture_list(
474         int position,
475         ArrayManufacture arrayManufacture
476     )
477     {
478         this.arrayManufacture_list.add(position, arrayManufacture);
479     }
480 
481     /**
482      *  Method to get ArrayManufacture from ArrayManufacture_list
483      *  
484      */
485     public
486     ArrayManufacture
487     getFromArrayManufacture_list(
488         int position
489     )
490     {
491         return (ArrayManufacture) this.arrayManufacture_list.get(position);
492     }
493 
494     /**
495      *  Method to remove by position from ArrayManufacture_list
496      *  
497      */
498     public
499     void
500     removeElementAtFromArrayManufacture_list(
501         int position
502     )
503     {
504         this.arrayManufacture_list.removeElementAt(position);
505     }
506 
507     /**
508      *  Method to remove first ArrayManufacture from 
509      *  ArrayManufacture_list
510      *  
511      */
512     public
513     void
514     removeFromArrayManufacture_list(
515         ArrayManufacture arrayManufacture
516     )
517     {
518         this.arrayManufacture_list.remove(arrayManufacture);
519     }
520 
521 }