コード例 #1
0
  public void write(
      String citationFilename,
      List<String> variableNameSet,
      String subsetUNF,
      String subsettingCriteria) {
    OutputStream outs = null;
    if (subsetUNF == null) {
      subsetUNF = "";
    }
    if (subsettingCriteria == null) {
      subsettingCriteria = "";
    }
    try {
      File cf = new File(citationFilename);
      outs = new BufferedOutputStream(new FileOutputStream(cf));
      PrintWriter pw = new PrintWriter(new OutputStreamWriter(outs, "utf8"), true);
      pw.println(title);
      pw.println(offlineCitation);

      if (generateSubsetCriteriaLine().equals("")) {
        pw.println("\n\n");
      } else {
        pw.println("\n");
        pw.println(generateSubsetCriteriaLine() + "\n");
      }
      pw.println(subsetTitle);
      pw.print(offlineCitation + " ");
      pw.print(DvnDSButil.joinNelementsPerLine(variableNameSet, 5));
      pw.println(" [VarGrp/@var(DDI)];");
      pw.println(subsetUNF);
      outs.close();
    } catch (IOException ex) {
      ex.printStackTrace();
    }
  }
コード例 #2
0
  public void write(File cf) {

    OutputStream outs = null;
    try {
      outs = new BufferedOutputStream(new FileOutputStream(cf));
      PrintWriter pw = new PrintWriter(new OutputStreamWriter(outs, "utf8"), true);
      pw.println(title);
      pw.println(offlineCitation);

      if (generateSubsetCriteriaLine().equals("")) {
        pw.println("\n\n");
      } else {
        pw.println("\n");
        pw.println(generateSubsetCriteriaLine() + "\n");
      }
      pw.println(subsetTitle);
      pw.print(offlineCitation + " ");
      pw.print(variableList);
      pw.println(" [VarGrp/@var(DDI)];");
      pw.println(subsetUNF);
      outs.close();
    } catch (IOException ex) {
      ex.printStackTrace();
    }
  }
コード例 #3
0
  public void writeWholeFileCase(File cf) {
    OutputStream outs = null;
    try {
      outs = new BufferedOutputStream(new FileOutputStream(cf));
      PrintWriter pw = new PrintWriter(new OutputStreamWriter(outs, "utf8"), true);
      pw.println(title);
      pw.println(offlineCitation);

      outs.close();
    } catch (IOException ex) {
      ex.printStackTrace();
    }
  }