コード例 #1
0
  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();
  }
コード例 #2
0
  /**
   * 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;
  }
コード例 #3
0
  private int addFactor(int count, String newFactor, TempFactors factor, int nextIndex) {
    headers.add(newFactor);
    colsToUse.add(nextIndex);

    TableFieldObject newFo;
    boolean unitAdded = false;

    for (TimeUnitPair tup : factor.getFactorLevels()) {
      if (!tup.getUnit().trim().equals("")) {
        headers.add("Unit");
        unitAdded = true;

        break;
      }
    }

    if (unitAdded) {
      // add factor column field first
      newFo =
          new TableFieldObject(
              count, newFactor, "Factor", DataTypes.STRING, "", false, false, false);
      buildingModel.addField(newFo);
      count++;

      newFo =
          new TableFieldObject(
              count,
              "Unit",
              "Unit to give meaning to it's associated value",
              DataTypes.ONTOLOGY_TERM,
              "",
              false,
              false,
              false);
      buildingModel.addField(newFo);
      count++;
    } else {
      newFo =
          new TableFieldObject(
              count, newFactor, "Factor", DataTypes.ONTOLOGY_TERM, "", false, false, false);
      buildingModel.addField(newFo);
      count++;
    }

    return count;
  }