affyfusion-109/src/affymetrix/calvin/array/PATAssignmentMethod.java

Code
Comments
Other
Rev Date Author Line
11 13 Sep 07 nicklas 1 /////////////////////////////////////////////////////////////////
11 13 Sep 07 nicklas 2 //
11 13 Sep 07 nicklas 3 // Copyright (C) 2005 Affymetrix, Inc.
11 13 Sep 07 nicklas 4 //
11 13 Sep 07 nicklas 5 // This library is free software; you can redistribute it and/or modify
11 13 Sep 07 nicklas 6 // it under the terms of the GNU Lesser General Public License as published
11 13 Sep 07 nicklas 7 // by the Free Software Foundation; either version 2.1 of the License,
11 13 Sep 07 nicklas 8 // or (at your option) any later version.
11 13 Sep 07 nicklas 9 //
11 13 Sep 07 nicklas 10 // This library is distributed in the hope that it will be useful, but
11 13 Sep 07 nicklas 11 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 13 Sep 07 nicklas 12 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 13 Sep 07 nicklas 13 // for more details.
11 13 Sep 07 nicklas 14 //
11 13 Sep 07 nicklas 15 // You should have received a copy of the GNU Lesser General Public License
11 13 Sep 07 nicklas 16 // along with this library; if not, write to the Free Software Foundation, Inc.,
11 13 Sep 07 nicklas 17 // 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 23 /** The method the probe array type was assigned. */
11 13 Sep 07 nicklas 24 public class PATAssignmentMethod {
11 13 Sep 07 nicklas 25   
11 13 Sep 07 nicklas 26     /** Unknown */
11 13 Sep 07 nicklas 27     public static final int NoAssignment=0;
11 13 Sep 07 nicklas 28     
11 13 Sep 07 nicklas 29     /** User entered an Affy barcode. */
11 13 Sep 07 nicklas 30     public static final int AffyBarcodeAssignment=1;
11 13 Sep 07 nicklas 31     
11 13 Sep 07 nicklas 32     /** User selected. */
11 13 Sep 07 nicklas 33     public static final int UserSelectedAssignment=2;
11 13 Sep 07 nicklas 34     
11 13 Sep 07 nicklas 35     /** Other method. */
11 13 Sep 07 nicklas 36     public static final int OtherAssignment=3;
11 13 Sep 07 nicklas 37
11 13 Sep 07 nicklas 38     /** No probe array type assignment. */
11 13 Sep 07 nicklas 39     private static final String PAT_ASSIGNMENT_NONE = "None";
11 13 Sep 07 nicklas 40
11 13 Sep 07 nicklas 41     /** Affy barcode selected probe array type. */
11 13 Sep 07 nicklas 42     private static final String PAT_ASSIGNMENT_BARCODE = "AffyBarcode";
11 13 Sep 07 nicklas 43
11 13 Sep 07 nicklas 44     /** User selected probe array type. */
11 13 Sep 07 nicklas 45     private static final String PAT_ASSIGNMENT_USER_SELECTED = "UserSelected";
11 13 Sep 07 nicklas 46
11 13 Sep 07 nicklas 47     /** Other assignment. */
11 13 Sep 07 nicklas 48     private static final String PAT_ASSIGNMENT_OTHER = "Other";
11 13 Sep 07 nicklas 49
11 13 Sep 07 nicklas 50     /** The method the probe array type was assigned. */
11 13 Sep 07 nicklas 51     private int pat;
11 13 Sep 07 nicklas 52     
11 13 Sep 07 nicklas 53     /** Gets the method the probe array type was assigned. */
11 13 Sep 07 nicklas 54     public int getMethod() { return pat; }
11 13 Sep 07 nicklas 55     
11 13 Sep 07 nicklas 56     /** Sets the method the probe array type was assigned. */
11 13 Sep 07 nicklas 57     public void setMethod(int m) { pat = m; }
11 13 Sep 07 nicklas 58
11 13 Sep 07 nicklas 59     /** Creates a new instance of PATAssignmentMethod */
11 13 Sep 07 nicklas 60     public PATAssignmentMethod() {
11 13 Sep 07 nicklas 61         pat = NoAssignment;
11 13 Sep 07 nicklas 62     }
11 13 Sep 07 nicklas 63
11 13 Sep 07 nicklas 64     /** Converts a string to the probe array assignment type.
11 13 Sep 07 nicklas 65      * @param str The string representation.
11 13 Sep 07 nicklas 66      */
11 13 Sep 07 nicklas 67     public PATAssignmentMethod(String str) {
11 13 Sep 07 nicklas 68   if (str .compareTo(PAT_ASSIGNMENT_NONE) == 0)
11 13 Sep 07 nicklas 69   {
11 13 Sep 07 nicklas 70             pat = NoAssignment;
11 13 Sep 07 nicklas 71   }
11 13 Sep 07 nicklas 72   else if (str .compareTo(PAT_ASSIGNMENT_BARCODE) == 0)
11 13 Sep 07 nicklas 73   {
11 13 Sep 07 nicklas 74             pat = AffyBarcodeAssignment;
11 13 Sep 07 nicklas 75   }
11 13 Sep 07 nicklas 76   else if (str .compareTo(PAT_ASSIGNMENT_USER_SELECTED) == 0)
11 13 Sep 07 nicklas 77   {
11 13 Sep 07 nicklas 78             pat = UserSelectedAssignment;
11 13 Sep 07 nicklas 79   }
11 13 Sep 07 nicklas 80   else if (str .compareTo(PAT_ASSIGNMENT_OTHER) == 0)
11 13 Sep 07 nicklas 81   {
11 13 Sep 07 nicklas 82             pat = OtherAssignment;
11 13 Sep 07 nicklas 83   }
11 13 Sep 07 nicklas 84   else
11 13 Sep 07 nicklas 85   {
11 13 Sep 07 nicklas 86             pat = NoAssignment;
11 13 Sep 07 nicklas 87   }
11 13 Sep 07 nicklas 88     }
11 13 Sep 07 nicklas 89
11 13 Sep 07 nicklas 90     /** Converts the probe array assignment type to a string.
11 13 Sep 07 nicklas 91      * @return The string representation.
11 13 Sep 07 nicklas 92      */
11 13 Sep 07 nicklas 93     public String toString() {
11 13 Sep 07 nicklas 94   switch (pat)
11 13 Sep 07 nicklas 95   {
11 13 Sep 07 nicklas 96   case NoAssignment:
11 13 Sep 07 nicklas 97             return PAT_ASSIGNMENT_NONE;
11 13 Sep 07 nicklas 98
11 13 Sep 07 nicklas 99   case AffyBarcodeAssignment:
11 13 Sep 07 nicklas 100             return PAT_ASSIGNMENT_BARCODE;
11 13 Sep 07 nicklas 101
11 13 Sep 07 nicklas 102   case UserSelectedAssignment:
11 13 Sep 07 nicklas 103             return PAT_ASSIGNMENT_USER_SELECTED;
11 13 Sep 07 nicklas 104
11 13 Sep 07 nicklas 105   case OtherAssignment:
11 13 Sep 07 nicklas 106             return PAT_ASSIGNMENT_OTHER;
11 13 Sep 07 nicklas 107   }
11 13 Sep 07 nicklas 108         return null;
11 13 Sep 07 nicklas 109     }
11 13 Sep 07 nicklas 110     
11 13 Sep 07 nicklas 111 }
11 13 Sep 07 nicklas 112
11 13 Sep 07 nicklas 113