Why Object[][][] ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
kim

Why Object[][][] ?

Post by kim » Tue Nov 06, 2001 6:54 am

Why does JFreeChart use Object[][][] to make DataSource ?
I'm really confused !! Why not implement Vector or something ??

David Gilbert

RE: Why Object[][][] ?

Post by David Gilbert » Wed Nov 07, 2001 2:53 pm

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.

Locked