1 18 19 package org.objectweb.jac.aspects.gui; 20 21 import java.io.IOException ; 22 import java.io.Writer ; 23 import org.jutils.csv.CSVWriter; 24 import org.objectweb.jac.util.Matrix; 25 26 30 public class MatrixUtils { 31 36 public static void toCSV(Matrix matrix, Writer writer) throws IOException { 37 CSVWriter out = new CSVWriter(writer); 38 int rowCount = matrix.getRowCount(); 39 for (int j=0; j<rowCount; j++) { 40 int colCount = matrix.getColumnCount(); 41 for (int i=0; i<colCount; i++) { 42 out.write(GuiAC.toString(matrix.get(i,j))); 43 } 44 out.writeln(); 45 } 46 writer.flush(); 47 } 48 } 49 | Popular Tags |