So, I know you can't use a variable in the case statement. I am hoping someone can point me to code that would be fairly efficient as a replacement. (I could do a bunch of ifs, for example).
The situation is that I have an array of object data, and I want to iterate through that array. The position in the array is given by a name as shown below (the int...ordinal statements). Basically I have to assign generate 'result' objects for certain members of the array (if they are discrete data such as C_VENT_RATE). The only way I can see this done easily is do a bunch of ifs such as if (i.equals(pr_int)).
ArrayList<String[]> rawEKGs = ekgFile.getForMrno( docInfo.getMedicalRecordNumber() );
for (String[] parts : rawEKGs) {
for (int i=0; i< parts.length; i++ )
{
Result result = docInfo.getResult();
boolean process = true;
final int vent_rate = UncEKG.COL_NAMES.C_VENT_RATE.ordinal();
int art_rate = UncEKG.COL_NAMES.C_ART_RATE.ordinal();
int pr_int = UncEKG.COL_NAMES.C_PR_INTERVAL.ordinal();
int qrs_dur = UncEKG.COL_NAMES.C_QRS_DURATION.ordinal();
int qt_qtc = UncEKG.COL_NAMES.C_QT_QTC.ordinal();
int prt = UncEKG.COL_NAMES.C_PRT_AXES.ordinal();
switch(i) {
case : // something
break;
default: process = false;
}