Java PrintWriter Write saveProcessedDataFile(double[][] data, String file)

Here you can find the source of saveProcessedDataFile(double[][] data, String file)

Description

Saves the given processed data to the specified file.

License

Open Source License

Parameter

Parameter Description
data the processed data - an array of (angle, count, error) arrays
file the file in which to save the data

Declaration

public static void saveProcessedDataFile(double[][] data, String file)
        throws IOException 

Method Source Code

//package com.java2s;
/*-// w w w.j ava  2s.co  m
 * Copyright ? 2009 Diamond Light Source Ltd.
 *
 * This file is part of GDA.
 *
 * GDA is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License version 3 as published by the Free
 * Software Foundation.
 *
 * GDA is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along
 * with GDA. If not, see <http://www.gnu.org/licenses/>.
 */

import java.io.IOException;

import java.io.PrintWriter;

public class Main {
    /**
     * Saves the given processed data to the specified file.
     * 
     * @param data
     *            the processed data - an array of (angle, count, error) arrays
     * @param file
     *            the file in which to save the data
     */
    public static void saveProcessedDataFile(double[][] data, String file)
            throws IOException {
        PrintWriter pw = new PrintWriter(file);
        for (double[] point : data) {
            pw.printf("%f %f %f%n", point[0], point[1], point[2]);
        }
        pw.close();
    }
}

Related

  1. saveLine(File file, String line)
  2. saveList(List list, OutputStream outs)
  3. saveMatrixAsADM(AtomicReferenceArray matrix, String path)
  4. saveMineField(File fileName, String mineField)
  5. saveProbabilityData(String file, double[] probabilities, double start, double dt)
  6. saveSet(Set set, File setFile, String encoding)
  7. saveSortedMap(Map map, File mapFile, String separator, String qualifier, String encoding)
  8. saveString(String theFilePath, String theString)
  9. saveStringAsFile(String string, String path)