1 package com.instantbank.component.parameter.util; 2 3 import java.util.*; 4 import java.io.Serializable; 5 6 /** 7 * Utility class allowing manipulation of set parameter values. 8 * 9 * @author InstantBank (Jorge Cardenas, Roberto Contreras). 10 * @created October 2002 11 */ 12 13 public class ParameterModel 14 implements Serializable { 15 16 /** 17 * Code of parameter. 18 */ 19 private String codeParameter; 20 21 /** 22 * Type of parameter, for all remaining types, this attribute is NULL. 23 * value: {numeric% | boolean | numeric_int | set | enum | string} 24 */ 25 private String parameterType; 26 27 /** 28 * Name of parameter. 29 */ 30 private String parameterName; 31 32 /** 33 * Description of parameter. 34 */ 35 private String parameterDescription; 36 37 /** 38 * If parameterType == "enum": 39 * this ArrayList contains Strings withalternative 40 * valuesfor the parameter. The first one must be 41 * "undefined". After it, the rest of possible 42 * values shall be included, alfabetically ordered. 43 * If parameterType == "set": 44 * this ArrayList contains Strings with all members 45 * of the universal set from which a subset is 46 * choosen as value of the parameter, alfabetically 47 * ordered. 48 * else, this attribute is NULL. 49 */ 50 private ArrayList possibleValue; 51 52 /** 53 * Name of level1Name. 54 */ 55 private String level1Name; 56 57 /** 58 * Name of level2Name. 59 */ 60 private String level2Name; 61 62 /** 63 * Values of level1 Point, ordered alfabetically, excluding '*' (ANY) 64 */ 65 private ArrayList level1Point; 66 67 /** 68 * Values of level2 Point, ordered alfabetically, excluding '*' (ANY) 69 */ 70 private ArrayList level2Point; 71 72 /** 73 * Order[i] contains the index of the 'header[]' array 74 * and of ValueRow.ParmCell[] that go in the i column 75 * of the screen. The two posible values of order[] are: 76 * 0,1,2,3 when CMP_SV_PARM_SEARCH2 == "1,*" 77 * 0,2,1,3 when CMP_SV_PARM_SEARCH2 == "*,2" 78 */ 79 private int[] order; 80 81 /** 82 *Information of Columns header. This array is ALWAYS: 83 * header[0]: header information for column "1,2" 84 * header[1]: header information for column "1,ANY" 85 * header[2]: header information for column "ANY,2" 86 * header[3]: header information for column "ANY,ANY" 87 */ 88 private Header[] header = new Header[4]; 89 90 /** 91 * Values for each combination of Level 1 Point and Level 2 Point. 92 * key Object: see 'Coordinate' Class 93 * value Object: see 'ValueRow' Class 94 */ 95 private Hashtable parmValue; 96 97 98 /** 99 * Constructor . <br> 100 * <br> 101 * 102 * @param codeParameter The code of parameter. 103 * @param parameterType The type of parameter. 104 * @param parameterName The name of parameter. 105 * @param parameterDescription The description of parameters. 106 * @param possibleValue The Array with possibles values (parameterType=enum | set). 107 * @param level1Name The name of level1. 108 * @param level2Name The name of level2. 109 * @param level1Point The Array of points for level1. 110 * @param level2Point The Array of points for level2. 111 * @param header The header for each search order. 112 * @param order The order for columns. 113 * @param parmValue The Hashtable of parameter values. 114 */ 115 public ParameterModel(String codeParameter, String parameterType, 116 String parameterName, String parameterDescription, 117 ArrayList possibleValue, String level1Name, String level2Name, 118 ArrayList level1Point, ArrayList level2Point, 119 Header header[], int order[], Hashtable parmValue) { 120 121 this.codeParameter = codeParameter; 122 this.parameterType = parameterType; 123 this.parameterName = parameterName; 124 this.parameterDescription = parameterDescription; 125 this.possibleValue = possibleValue; 126 this.level1Name = level1Name; 127 this.level2Name = level2Name; 128 this.level1Point = level1Point; 129 this.level2Point = level2Point; 130 this.header = header; 131 this.order = order; 132 this.parmValue = parmValue; 133 } 134 135 136 /** 137 * Getter method for code parameter. 138 * 139 * @return The code parameter value 140 */ 141 public String getCodeParameter() { 142 return (this.codeParameter); 143 } 144 145 146 /** 147 * Getter method for type of parameter. 148 * 149 * @return The type value 150 */ 151 public String getParameterType() { 152 return (this.parameterType); 153 } 154 155 156 /** 157 * Getter method for name of parameter. 158 * 159 * @return The name value 160 */ 161 public String getParameterName() { 162 return (this.parameterName); 163 } 164 165 166 /** 167 * Getter method for description of parameter. 168 * 169 * @return The description value 170 */ 171 public String getParameterDescription() { 172 return (this.parameterDescription); 173 } 174 175 176 /** 177 * Getter method for possibles values of parameterType: "enum" 178 * parameterType: "set". 179 * 180 * @return ArrayList of possibles values 181 */ 182 public ArrayList getPossibleValue() { 183 return (this.possibleValue); 184 } 185 186 187 /** 188 * Getter method for name of level1Name. 189 * 190 * @return The Level1Name value 191 */ 192 public String getLevel1Name() { 193 return (this.level1Name); 194 } 195 196 197 /** 198 * Getter method for name of level2Name. 199 * 200 * @return The Level2Name value 201 */ 202 public String getLevel2Name() { 203 return (this.level2Name); 204 } 205 206 207 /** 208 * Getter method for the values of Level 1 Point. 209 * 210 * @return The Level1Point values 211 */ 212 public ArrayList getLevel1Point() { 213 return (this.level1Point); 214 } 215 216 217 /** 218 * Getter method for the values of Level 2 Point. 219 * 220 * @return The Level2Point values 221 */ 222 public ArrayList getLevel2Point() { 223 return (this.level2Point); 224 } 225 226 227 /** 228 * Getter method for order of parameter value. 229 * 230 * @return The order values 231 */ 232 public int[] getOrder() { 233 return (this.order); 234 } 235 236 237 /** 238 * Setter method for header of parameter. 239 * 240 * @param header The new header value 241 */ 242 public void setHeader(Header header[]) { 243 this.header = header; 244 } 245 246 247 /** 248 * Getter method for header of parameter. 249 * 250 * @return The header values 251 */ 252 public Header[] getHeader() { 253 return (this.header); 254 } 255 256 257 /** 258 * Setter method for the values for each point. 259 * 260 * @param parmValue Hashtable values 261 */ 262 public void setParmValue(Hashtable parmValue) { 263 this.parmValue = parmValue; 264 } 265 266 267 /** 268 * Getter method for the values for each point. 269 * 270 * @return The parmValue values 271 */ 272 public Hashtable getParmValue() { 273 return (this.parmValue); 274 } 275 } 276 277