I am using and Arraylist for sor soil samples because I don't know the number of samples and the depth of each sample. I am having a problem setting up my Arraylist and would appreciate some help.
In general the sample can be handled with a two diminsional array.
int[][] layerdepth = new int[][]; // where layerdepth[sample number
unknow][depth unknow]
int[][] watercapity = new int[][]; // where water capacity[sample number
unknow][depth unknow]
I thought I could add this to an Arraylist By:
ArrayList asoildata = new Arraylist;
asoildata.add(sample number, layerdepth);
But it will not work. I need to retrieve data by sample number, and suggestions would be appreciated.
Thanks...Ronnie
In general the sample can be handled with a two diminsional array.
int[][] layerdepth = new int[][]; // where layerdepth[sample number
unknow][depth unknow]
int[][] watercapity = new int[][]; // where water capacity[sample number
unknow][depth unknow]
I thought I could add this to an Arraylist By:
ArrayList asoildata = new Arraylist;
asoildata.add(sample number, layerdepth);
But it will not work. I need to retrieve data by sample number, and suggestions would be appreciated.
Thanks...Ronnie