• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help creating java Object (data type)

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you give me a bit more detail, Im not exactly sure how to implement what you mean
 
reply
    Bookmark Topic Watch Topic
  • New Topic