File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Linked List, List iterator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Linked List, List iterator" Watch "Linked List, List iterator" New topic
Author

Linked List, List iterator

lynn seeto
Greenhorn

Joined: Mar 16, 2004
Posts: 1
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?
Warren Dew
blacksmith
Ranch Hand

Joined: Mar 04, 2004
Posts: 1332
    
    2
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.
 
 
subject: Linked List, List iterator