/* * WritableTableDataSet.java * * Created on September 2, 2004, 11:58 AM */ package org.das2.dataset; import org.das2.datum.Datum; import org.das2.datum.DatumVector; import org.das2.datum.Units; import java.util.*; import java.util.Map; /** * * @author Jeremy */ public class WritableTableDataSet implements TableDataSet { double[] z; double[] x; double[] y; final int nx; final int ny; Units xunits; Units yunits; Units zunits; Map properties; public static WritableTableDataSet newSimple( int nx, Units xunits, int ny, Units yunits, Units zunits ) { double [] z= new double[nx*ny]; double [] x= new double[nx]; double [] y= new double[ny]; return new WritableTableDataSet( x, xunits, y, yunits, z, zunits, new HashMap() ); } public static WritableTableDataSet newEmpty( TableDataSet tds ) { if ( tds.tableCount() > 1 ) throw new IllegalArgumentException("only supported for simple tables"); int nx= tds.tableEnd(0); int ny= tds.getYLength(0); WritableTableDataSet result= newSimple( nx, tds.getXUnits(), ny, tds.getYUnits(), tds.getZUnits() ); for ( int i=0; i 1 ) throw new IllegalArgumentException("only supported for simple tables"); int nx= tds.tableEnd(0); int ny= tds.getYLength(0); WritableTableDataSet result= newEmpty( tds ); for ( int i=0; i