Why does JFreeChart use Object[][][] to make DataSource ?
I'm really confused !! Why not implement Vector or something ??
Why Object[][][] ?
RE: Why Object[][][] ?
Hi Kim,
Initially I just had the CategoryDataSource and XYDataSource interfaces, and left it to developers to write their own implementations around their own data structures...this is still the preferred approach, as it saves copying data from one place to another.
I got swamped with e-mails from people asking me how to create a data source from an array, so I wrote two of the ugliest classes around (DefaultCategoryDataSource and DefaultXYDataSource). The e-mails stopped, but now I occasionally get questions about Object[][][] instead (and rightly so, since this structure is not intuitive at all).
I don't find the array approach useful, so in the next release I will change the DefaultXXXDataSource classes so that they use a more natural API. Something along the lines of the TimeSeriesDataset class that is available in the CVS repository on SourceForge...
Regards,
DG.
Initially I just had the CategoryDataSource and XYDataSource interfaces, and left it to developers to write their own implementations around their own data structures...this is still the preferred approach, as it saves copying data from one place to another.
I got swamped with e-mails from people asking me how to create a data source from an array, so I wrote two of the ugliest classes around (DefaultCategoryDataSource and DefaultXYDataSource). The e-mails stopped, but now I occasionally get questions about Object[][][] instead (and rightly so, since this structure is not intuitive at all).
I don't find the array approach useful, so in the next release I will change the DefaultXXXDataSource classes so that they use a more natural API. Something along the lines of the TimeSeriesDataset class that is available in the CVS repository on SourceForge...
Regards,
DG.