Example #1
0
  private void writeListErrors(
      FileWriter fileOut,
      Vector deviationMessages,
      Vector databaseValues,
      String ind,
      char delimeter,
      String variable,
      String value,
      String date,
      String ref,
      String comm) {

    try {

      if (errorList.size() > 0 || deviationMessages.size() > 0 || warningList.size() > 0) {
        fileOut.write("#--------------------------------------------------\n");
      }
      if (errorList.size() > 0) {
        for (int i = 0; i < errorList.size(); i++) {
          fileOut.write("#" + (String) errorList.get(i) + "\n");
        }
      }
      if (warningList.size() > 0) {
        for (int i = 0; i < warningList.size(); i++) {
          fileOut.write("#" + (String) warningList.get(i) + "\n");
        }
      }

      if (deviationMessages.size() > 0) {
        for (int i = 0; i < deviationMessages.size(); i++) {
          fileOut.write("#" + (String) deviationMessages.elementAt(i) + "\n");
        }
        // write old values
        fileOut.write("#" + databaseValues.elementAt(0) + "\n");
      }
      // if there are errors, the string is "Outcommented"
      if (errorList.size() > 0) {
        fileOut.write("#");
      }

      // write original string
      fileOut.write(
          ind + delimeter + variable + delimeter + value + delimeter + date + delimeter + ref
              + delimeter + comm + "\n");

      if (errorList.size() > 0 || deviationMessages.size() > 0 || warningList.size() > 0) {
        fileOut.write("#--------------------------------------------------\n");
      }

    } // try
    catch (Exception e) {
      e.printStackTrace(System.err);
    }
  }
Example #2
0
  /**
   * @param fileOut
   * @param errorMessages
   * @param warningMessages
   * @param deviationMessages
   * @param databaseValues
   * @param ind
   * @param delimeter
   * @param marker
   * @param allele1
   * @param allele2
   * @param raw1
   * @param raw2
   * @param ref
   * @param comm
   */
  private void writeTitleErrors(FileWriter fileOut, Vector titleError) {

    try {

      if (titleError.size() > 0) {
        fileOut.write("#--------------------------------------------------\n");
        for (int i = 0; i < titleError.size(); i++) {
          fileOut.write("#" + (String) titleError.elementAt(i) + "\n");
        }
        fileOut.write("#--------------------------------------------------\n");
      }
    } catch (Exception e) {
      e.printStackTrace(System.err);
    }
  }
Example #3
0
  /**
   * @param fileOut
   * @param errorMessages
   * @param warningMessages
   * @param deviationMessages
   * @param databaseValues
   * @param newAlleles
   * @param ind
   * @param delim
   * @param marker
   * @param allele1
   * @param allele2
   */
  private void writeMatrixErrors(
      FileWriter fileOut,
      Vector deviationMessages,
      Vector databaseValues,
      Vector values,
      String ind,
      char delim,
      String variable,
      String value) {
    try {
      // if row contains comments
      if (errorList.size() > 0 || deviationMessages.size() > 0 || warningList.size() > 0) {
        fileOut.write("#--------------------------------------------------------\n");
      }
      if (errorList.size() > 0) {
        for (int i = 0; i < errorList.size(); i++) {
          fileOut.write("#" + (String) errorList.get(i) + "\n");
        }
      }

      if (warningList.size() > 0) {
        for (int i = 0; i < warningList.size(); i++) {
          fileOut.write("#" + (String) warningList.get(i) + "\n");
        }
      }

      if (deviationMessages.size() > 0) {
        for (int i = 0; i < deviationMessages.size(); i++) {
          fileOut.write("#" + (String) deviationMessages.elementAt(i) + "\n");
        }
        // write database values
        fileOut.write("#" + ind);
        for (int i = 0; i < databaseValues.size(); i++) {
          fileOut.write(delim + (String) databaseValues.elementAt(i));
        }
        fileOut.write("\n");
      }
      // write row from file:
      if (errorList.size() > 0) {
        fileOut.write("#");
      }
      fileOut.write(ind);

      for (int i = 0; i < values.size(); i++) {
        fileOut.write(delim + (String) values.elementAt(i));
      }
      fileOut.write("\n");

      /*
      for (int i=0;i<newAlleles.size();i++)
      {
          fileOut.write(delim+(String)newAlleles.elementAt(i));
      }
      fileOut.write("\n");
      */

      // fileOut.write(delim+allele1);
      // fileOut.write(delim+allele2);
      // fileOut.write("\n");

      if (errorList.size() > 0 || deviationMessages.size() > 0 || warningList.size() > 0) {
        fileOut.write("#--------------------------------------------------------\n");
      }
    } // try
    catch (Exception e) {
      e.printStackTrace(System.err);
    }
  }