package org.autoplot.hapiserver; import java.io.IOException; import java.io.OutputStream; import java.text.DecimalFormat; import java.text.ParseException; import java.util.logging.Level; import java.util.logging.Logger; import org.das2.datum.Datum; import org.das2.datum.Units; import org.das2.datum.UnitsUtil; import org.das2.datum.format.DatumFormatter; import org.das2.datum.format.EnumerationDatumFormatter; import org.das2.datum.format.TimeDatumFormatter; import org.das2.qds.DDataSet; import org.das2.util.NumberFormatUtil; import org.json.JSONObject; import org.das2.qds.DataSetUtil; import org.das2.qds.QDataSet; import org.das2.qds.SparseDataSetBuilder; import org.das2.qds.WritableDataSet; import org.json.JSONArray; import org.json.JSONException; /** * Comma Separated Value (CSV) formatter * @author jbf */ public class CsvDataFormatter implements DataFormatter { private static final Logger logger= Logger.getLogger("hapi.csv"); boolean[] unitsFormatter; DatumFormatter[] datumFormatter; boolean[] quotes; Units[] units; @Override public void initialize( JSONObject info, OutputStream out, QDataSet record) { unitsFormatter= new boolean[record.length()]; datumFormatter= new DatumFormatter[record.length()]; quotes= new boolean[record.length()]; units= new Units[record.length()]; for ( int i=0; i