This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Performance and the fly likes I need data structure advice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Performance
Bookmark "I need data structure advice" Watch "I need data structure advice" New topic

I need data structure advice

Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

Hello, I want some advice on how to organise this.

I have 8 channels, each channel has 300 toggle points, each toggle points has 7 bytes of data. I was thinking of doing this

or alternatively creating a class called togglePoint and creating lots of instances of this.

Jesus lives
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

Create the class version.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12792
I agree with C. Lamont - with the other version you build many more objects than necessary. The only time the byte[][][] would be preferable would be if the data was quite sparse and irregular in data size.
GeeCON Prague 2014
subject: I need data structure advice