> > Hello,
> > I have ArrayLists that are Channel1, Channel 2......Channel16
[quoted text clipped - 11 lines]
> What you want is an array of ArrayLists: Channel[0][...etc...],
> Channel[1][...etc...], and so on.
Actually the data started out as Arrays and I am finding ArrayLists
allow me to clean the data easier.
I have 12 boards with 16 channels on each board.The amount of data
changes between channels and boards.
I should still be able to use some kind of "for statenent to do my
cleansing on a "Channel+i" basis.
Right?
Thanks
Mike
Jon Skeet [C# MVP] - 17 Mar 2008 18:02 GMT
<snip>
> > What you want is an array of ArrayLists: Channel[0][...etc...],
> > Channel[1][...etc...], and so on.
[quoted text clipped - 5 lines]
> I should still be able to use some kind of "for statenent to do my
> cleansing on a "Channel+i" basis.
To be honest, it sounds like you need Board type - and then a list of
boards. Any time you end up with something 2-dimensional (or appearing
to be) it's worth considering whether an extra bit of encapsulation
would help.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
AMP - 17 Mar 2008 20:12 GMT
> <snip>
>
[quoted text clipped - 16 lines]
> Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk
So,
I am taking your advise and now that I cleaned the data I want to put
it back into an Array from Array list.
But the Array is going to be 2 dimentional:
int[][] BoardChannel = new int[16][];
I want to pu each of the 16 Channel ArrayLists into it.
HELP.
Thanks
Mike
Jon Skeet [C# MVP] - 17 Mar 2008 20:29 GMT
<snip>
> I am taking your advise and now that I cleaned the data I want to put
> it back into an Array from Array list.
> But the Array is going to be 2 dimentional:
> int[][] BoardChannel = new int[16][];
> I want to pu each of the 16 Channel ArrayLists into it.
> HELP.
If you are taking my advice, you won't have 16 channel ArrayLists.
You'll have a single ArrayList populated with Boards.
I'm afraid you'll need to clarify what exactly you want to achieve -
it's not very clear at the moment.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
AMP - 17 Mar 2008 20:43 GMT
> <snip>
>
[quoted text clipped - 14 lines]
> Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk
What I have is data that goes through a number of functions to clean
and rearrange the data. This is for a physics experiment.
The Arraylist is a great way to keep the array size to a minimal
automatically as I work on it.
But after I have all 16 channels cleaned I want to put them back into
an Array to graph them.
Does this help?
Thanks
Mike
Jon Skeet [C# MVP] - 17 Mar 2008 21:17 GMT
<snip>
> What I have is data that goes through a number of functions to clean
> and rearrange the data. This is for a physics experiment.
[quoted text clipped - 3 lines]
> an Array to graph them.
> Does this help?
Not really, I'm afraid. Why do you need them in an Array? Does your
graphing library (or whatever) really not accept other collections?
However, if you have to, I'd add a method to your Board class -
something like:
public int[] ToArray()
{
...
}
Then potentially call ToArray on each board, building up an ArrayList
of int[]s, then call ToArray on *that* ArrayList.
(Are you stuck with .NET 1.1, by the way? It would be neater with
List<T> in in .NET 2.0. With .NET 3.5 you could quite possibly do it
all *really* nicely with LINQ, and then automatically parallelise
it...)

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Steve Gerrard - 18 Mar 2008 03:44 GMT
>> "AMP" <ampel...@gmail.com> wrote in message
>>
[quoted text clipped - 3 lines]
> Actually the data started out as Arrays and I am finding ArrayLists
> allow me to clean the data easier.
I think you missed that AMP wrote "an array of ArrayLists."
If you wanted, though, you could also have "an ArrayList of ArrayLists."
1. Create a new ArrayList called Temp
2. Add Channel1 to it, add Channel2 to it, ....
3. Do a loop on Temp, processing each channel in turn
4. Toss Temp, unless you want to keep it