Get your CodeRanch badge!*
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

Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 12682
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.

Java Resources at
subject: I need data structure advice
Similar Threads
Class Design Advice For Objects With Many Data Points
URLBirdy(1.3.2) Create method
byte array to String
Binary/Octal/Hex and Decimal Number Systems
convert long to byte array and back