• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help creating java Object (data type)

 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating an Object to hold a String projectName; and two other variables:

The first is a list of devices, which right now is just a List that belong to each projectName. I also need a List of channels that belong to each device. However I don't think it will work for me to just make this a List as well, because when I perform operations to populate the variables, the channels List will only be populated with the last set of channels it finds (or maybe all the channels for all devices).

If I have a project that has this layout:

project

-device1
--channel 1-1
--channel 1-2

-device 2
--channel 2-1

-device 3
--channel 3-1
--channel 3-2

It is not a problem to set the String projectName to the one project value, and I can put all the devices in one List without a problem. However the only way I would know to work the channels out in order to show ownership with a device is to create 3 channel List variables, one List to hold each of the channels for each device. And since there may be more or less devices and channels for each project this is a problem.

The end goal is to use this on a rich:tree, but I want to first see what my options are for data types. I really have no idea what would work for this
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34223
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt,
How about a list of ChannelSet objects? The ChannelSet could contain the device id and a list of channels for it.
 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give me a bit more detail, Im not exactly sure how to implement what you mean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic