protected void runAlgorithm() { // Retrieve a list of string values dictating where elements are supposed to occur in a table. tableStructure = buildingModel.getTableStructure(); headers = new ArrayList<String>(); colsToUse = new ListOrderedSet<Integer>(); int count = tableStructure.size() + 1; for (int i = 0; i < tableStructure.size(); i++) { // modify this to only add those factors which appear in temp factors. if (tableStructure.get(i)[0].toLowerCase().equals("factors")) { for (TempFactors factor : factorsToAdd) { String newFactor = "Factor Value[" + factor.getFactorName().trim() + "]"; addFactor(count, newFactor, factor, i); } } else if (tableStructure.get(i)[0].toLowerCase().contains("factor value[")) { // doing nothing with this factor } else if (tableStructure.get(i)[0].toLowerCase().contains("characteristics[")) { String newChar = tableStructure.get(i)[0]; headers.add(newChar); colsToUse.add(i); } else { headers.add(tableStructure.get(i)[0]); colsToUse.add(i); } } performAssayCentricTask(); }
/** * This is a check employed to ensure that we are not adding factors that are already defined * inside the configuration. * * @param columnName - Name of column to be added. * @return boolean - true if already present, false otherwise */ protected boolean checkForFactorExistence(String columnName) { for (TempFactors tf : factorsToAdd) { String fullFactorName = "Factor Value[" + tf.getFactorName() + "]"; if (fullFactorName.equalsIgnoreCase(columnName)) { return true; } } return false; }