• 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

Linked List, List iterator

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can the linked list store like a list of information?
eg a booking List with the index as its booking number, can each index store like a whole chunk of info? eg name, contact, status, size, date, time,..? and how do i retrieve the info stored by the booking number? like if i wanted to edit the status, do i use the set(int index, Object element)? what does this Object here mean?
 
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

can the linked list store like a list of information?
eg a booking List with the index as its booking number, can each index store like a whole chunk of info? ... and how do i retrieve the info stored by the booking number?


What you actually want is a java.util.Map. A Map associates keys - in this case the booking number - with Objects containing chunks of information.
What you do is create a Class that stores all the information you need, something like:

You'd also add functions to the class that would allow you to access and change the information.
The Map would then contain a bunch of Booking_Data objects, each with the information for a different booking. To change information, you would get the object from the list using the booking number, then change the information in the object using the functions you wrote.
You might want to pick up a book on Java for more details. I started with "Java in a Nutshell", which is published by O'Reilly. Or if what you really want is to be a travel agent rather than a programmer, you might consider hiring a programmer to help you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic