Java FileWriter Write savePValue2File(double[] pValue, String fileName)

Here you can find the source of savePValue2File(double[] pValue, String fileName)

Description

save P Value File

License

Open Source License

Declaration

public static void savePValue2File(double[] pValue, String fileName) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static void savePValue2File(double[] pValue, String fileName) throws IOException {
        FileWriter fw = null;//from  w  ww. j  a va2 s.  co  m
        fw = new FileWriter(fileName);
        String str = "";
        if (pValue != null) {
            for (int i = 0; i < pValue.length; i++) {
                str = str + pValue[i];
                str = str + "\n";
            }
        } else {
            str = "null";
        }
        fw.write(str);
        fw.close();
    }

    public static void savePValue2File(double[] pValue, String fileName, boolean flag) throws IOException {
        FileWriter fw = null;
        fw = new FileWriter(fileName);
        String str = "";
        if (pValue != null) {
            for (int i = 0; i < pValue.length; i++) {
                str = str + i + "\t" + pValue[i];
                str = str + "\n";
            }
        } else {
            str = "null";
        }
        fw.write(str);
        fw.close();
    }
}

Related

  1. saveMappingFile(File mappingFile, Map messageMap)
  2. saveMeasures(String appDirPath, String fileName, double[] measures)
  3. saveMetaClassToFile(File baseDir, String clazzDef, String metaPackageName, Class fromClazz)
  4. saveMetadata(Map metadata, File file)
  5. saveModelInFile(final String model, final String filename)
  6. saveSeqAln(String[] alnSequences, String filePath)
  7. saveSimpleTextFile(String data, String path, String filename)
  8. saveStats(String filename, String log)
  9. saveString(File filename, String content)