1 9 package org.jrobin.core.jrrd; 10 11 17 public class DataChunk { 18 19 private static final String NEWLINE = System.getProperty("line.separator"); 20 long startTime; 21 int start; 22 int end; 23 long step; 24 int dsCount; 25 double[][] data; 26 int rows; 27 28 DataChunk(long startTime, int start, int end, long step, int dsCount, int rows) { 29 this.startTime = startTime; 30 this.start = start; 31 this.end = end; 32 this.step = step; 33 this.dsCount = dsCount; 34 this.rows = rows; 35 data = new double[rows][dsCount]; 36 } 37 38 45 public String toString() { 46 47 StringBuffer sb = new StringBuffer (); 48 long time = startTime; 49 50 for (int row = 0; row < rows; row++, time += step) { 51 sb.append(time); 52 sb.append(": "); 53 54 for (int ds = 0; ds < dsCount; ds++) { 55 sb.append(data[row][ds]); 56 sb.append(" "); 57 } 58 59 sb.append(NEWLINE); 60 } 61 62 return sb.toString(); 63 } 64 } 65 | Popular Tags |