1 package test.prefuse.data; 2 3 import java.sql.Date ; 4 import java.sql.Time ; 5 import java.util.Calendar ; 6 import java.util.GregorianCalendar ; 7 8 import prefuse.util.TimeLib; 9 10 public interface TableTestData { 11 12 public static final Calendar CAL = GregorianCalendar.getInstance(); 13 14 public static final int NROWS = 4; 15 public static final int NCOLS = 6; 16 17 public static final String [] HEADERS 18 = { "id", "date", "time", "float", "double", "text" }; 19 20 public static final Class [] TYPES 21 = { int.class, Date .class, Time .class, 22 float.class, double.class, String .class }; 23 24 public static final Integer [] COLUMN1 25 = { new Integer (1), new Integer (2), 26 new Integer (3), new Integer (4) }; 27 28 public static final Date [] COLUMN2 29 = { new Date (TimeLib.getDate(CAL,2001,0,1)), 30 new Date (TimeLib.getDate(CAL,1979,5,15)), 31 new Date (TimeLib.getDate(CAL,1982,2,19)), 32 new Date (TimeLib.getDate(CAL,2053,4,13)) }; 33 34 public static final Time [] COLUMN3 35 = { new Time (TimeLib.getTime(CAL,1,12,0)), 36 new Time (TimeLib.getTime(CAL,3,14,0)), 37 new Time (TimeLib.getTime(CAL,1,12,0)), 38 new Time (TimeLib.getTime(CAL,19,12,0)) }; 39 40 public static final Float [] COLUMN4 41 = { new Float (1.1f), new Float (2.3f), 42 new Float (1e-4f), new Float (1e6f) }; 43 44 public static final Double [] COLUMN5 45 = { new Double (12.34), new Double (3.3334), 46 new Double (1e4), new Double (1.3e-2) }; 47 48 public static final String [] COLUMN6 49 = { "This is some text.", "13f", "12.3", 50 "This is some \"quoted\", comma'd text" }; 51 52 53 public static final Object [][] TABLE 54 = { COLUMN1, COLUMN2, COLUMN3, COLUMN4, COLUMN5, COLUMN6 }; 55 56 public static final String CSV_DATA = 57 "id,date,time,float,double,text\n" + 58 "1,1/1/2001,1:12 AM,1.1f,12.34,This is some text.\n" + 59 "2,6/15/1979,3:14 AM,2.3f,3.3334,13f\n" + 60 "3,3/19/1982,1:12 AM,1e-4f,1.00E+04,12.3\n" + 61 "4,5/13/2053,7:12 PM,1e6f,1.30E-02,\"This is some \"\"quoted\"\", comma'd text\"\n"; 62 63 public static final String TAB_DELIMITED_DATA = 64 "id\tdate\ttime\tfloat\tdouble\ttext\n" + 65 "1\t1/1/2001\t1:12 AM\t1.1f\t12.34\tThis is some text.\n" + 66 "2\t6/15/1979\t3:14 AM\t2.3f\t3.3334\t13f\n" + 67 "3\t3/19/1982\t1:12 AM\t1e-4f\t1.00E+04\t12.3\n" + 68 "4\t5/13/2053\t7:12 PM\t1e6f\t1.30E-02\tThis is some \"quoted\", comma'd text\n"; 69 70 } 71 | Popular Tags |