11 |
13 Sep 07 |
nicklas |
1 |
///////////////////////////////////////////////////////////////// |
11 |
13 Sep 07 |
nicklas |
2 |
// |
11 |
13 Sep 07 |
nicklas |
// Copyright (C) 2005 Affymetrix, Inc. |
11 |
13 Sep 07 |
nicklas |
4 |
// |
11 |
13 Sep 07 |
nicklas |
// This library is free software; you can redistribute it and/or modify |
11 |
13 Sep 07 |
nicklas |
// it under the terms of the GNU Lesser General Public License as published |
11 |
13 Sep 07 |
nicklas |
// by the Free Software Foundation; either version 2.1 of the License, |
11 |
13 Sep 07 |
nicklas |
// or (at your option) any later version. |
11 |
13 Sep 07 |
nicklas |
9 |
// |
11 |
13 Sep 07 |
nicklas |
// This library is distributed in the hope that it will be useful, but |
11 |
13 Sep 07 |
nicklas |
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
11 |
13 Sep 07 |
nicklas |
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License |
11 |
13 Sep 07 |
nicklas |
// for more details. |
11 |
13 Sep 07 |
nicklas |
14 |
// |
11 |
13 Sep 07 |
nicklas |
// You should have received a copy of the GNU Lesser General Public License |
11 |
13 Sep 07 |
nicklas |
// along with this library; if not, write to the Free Software Foundation, Inc., |
11 |
13 Sep 07 |
nicklas |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
11 |
13 Sep 07 |
nicklas |
18 |
// |
11 |
13 Sep 07 |
nicklas |
19 |
///////////////////////////////////////////////////////////////// |
11 |
13 Sep 07 |
nicklas |
20 |
|
11 |
13 Sep 07 |
nicklas |
21 |
package affymetrix.calvin.array; |
11 |
13 Sep 07 |
nicklas |
22 |
|
11 |
13 Sep 07 |
nicklas |
/** Defines constants for the media an array is housed. */ |
11 |
13 Sep 07 |
nicklas |
24 |
public class ArrayMedia { |
11 |
13 Sep 07 |
nicklas |
25 |
|
11 |
13 Sep 07 |
nicklas |
/** A GeneChip cartridge. */ |
11 |
13 Sep 07 |
nicklas |
27 |
public static final int CartridgeMedia=0; |
11 |
13 Sep 07 |
nicklas |
28 |
|
11 |
13 Sep 07 |
nicklas |
/** A 96 well plate or peg strip. */ |
11 |
13 Sep 07 |
nicklas |
30 |
public static final int PlateOrStripMedia=1; |
11 |
13 Sep 07 |
nicklas |
31 |
|
11 |
13 Sep 07 |
nicklas |
/** The GeneChip cartridge. */ |
11 |
13 Sep 07 |
nicklas |
33 |
private static final String MEDIA_TYPE_CARTRIDGE = "Cartridge"; |
11 |
13 Sep 07 |
nicklas |
34 |
|
11 |
13 Sep 07 |
nicklas |
/** A 96 well plate or strip. */ |
11 |
13 Sep 07 |
nicklas |
36 |
private static final String MEDIA_TYPE_PLATE_OR_STRIP = "PlateOrStrip"; |
11 |
13 Sep 07 |
nicklas |
37 |
|
11 |
13 Sep 07 |
nicklas |
/** The type of media of the array. */ |
11 |
13 Sep 07 |
nicklas |
39 |
private int media; |
11 |
13 Sep 07 |
nicklas |
40 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the media value. */ |
11 |
13 Sep 07 |
nicklas |
42 |
public int getMedia() { return media; } |
11 |
13 Sep 07 |
nicklas |
43 |
|
11 |
13 Sep 07 |
nicklas |
/** Sets the media value. */ |
11 |
13 Sep 07 |
nicklas |
45 |
public void setMedia(int m) { media = m; } |
11 |
13 Sep 07 |
nicklas |
46 |
|
11 |
13 Sep 07 |
nicklas |
/** Converts the media type to a string. |
11 |
13 Sep 07 |
nicklas |
* @return The string representation. |
11 |
13 Sep 07 |
nicklas |
49 |
*/ |
11 |
13 Sep 07 |
nicklas |
50 |
public String toString() { |
11 |
13 Sep 07 |
nicklas |
51 |
switch (media) |
11 |
13 Sep 07 |
nicklas |
52 |
{ |
11 |
13 Sep 07 |
nicklas |
53 |
case CartridgeMedia: |
11 |
13 Sep 07 |
nicklas |
54 |
return MEDIA_TYPE_CARTRIDGE; |
11 |
13 Sep 07 |
nicklas |
55 |
|
11 |
13 Sep 07 |
nicklas |
56 |
case PlateOrStripMedia: |
11 |
13 Sep 07 |
nicklas |
57 |
return MEDIA_TYPE_PLATE_OR_STRIP; |
11 |
13 Sep 07 |
nicklas |
58 |
} |
11 |
13 Sep 07 |
nicklas |
59 |
return null; |
11 |
13 Sep 07 |
nicklas |
60 |
} |
11 |
13 Sep 07 |
nicklas |
61 |
|
11 |
13 Sep 07 |
nicklas |
/** Creates a new instance given a string representation of the media. |
11 |
13 Sep 07 |
nicklas |
* @param str The string representation. |
11 |
13 Sep 07 |
nicklas |
64 |
*/ |
11 |
13 Sep 07 |
nicklas |
65 |
public ArrayMedia(String str) { |
11 |
13 Sep 07 |
nicklas |
66 |
if (str.compareTo(MEDIA_TYPE_CARTRIDGE) == 0) |
11 |
13 Sep 07 |
nicklas |
67 |
media = CartridgeMedia; |
11 |
13 Sep 07 |
nicklas |
68 |
|
11 |
13 Sep 07 |
nicklas |
69 |
else if (str.compareTo(MEDIA_TYPE_PLATE_OR_STRIP) == 0) |
11 |
13 Sep 07 |
nicklas |
70 |
media = PlateOrStripMedia; |
11 |
13 Sep 07 |
nicklas |
71 |
|
11 |
13 Sep 07 |
nicklas |
72 |
else |
11 |
13 Sep 07 |
nicklas |
73 |
media = CartridgeMedia; |
11 |
13 Sep 07 |
nicklas |
74 |
} |
11 |
13 Sep 07 |
nicklas |
75 |
|
11 |
13 Sep 07 |
nicklas |
/** Creates a new instance of ArrayMedia */ |
11 |
13 Sep 07 |
nicklas |
77 |
public ArrayMedia() { |
11 |
13 Sep 07 |
nicklas |
78 |
media = CartridgeMedia; |
11 |
13 Sep 07 |
nicklas |
79 |
} |
11 |
13 Sep 07 |
nicklas |
80 |
|
11 |
13 Sep 07 |
nicklas |
81 |
} |