Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HashMap & ArrayList collections

 
Iain Linton
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have:


I have a Class Member

my question is:

how do I get a member to join a trip (both the Member and Trip should be paremeters)

Do I have to convert the HashMap into a collection and iterate over it to get the trip code, also iterate over the ArrayList to get the member then join the on the trip.

The question is how?

All help would be greatly appreciated
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to give us more information about what it means for a Member to "join" a Trip. Also, what exactly is in the HashMap (what are the key/value pairs)? And what is a "trip code"?

Or better yet, what have you tried, and what went wrong?
[ March 14, 2006: Message edited by: marc weber ]
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have in your List and what do you have in your Map.

You will have to use an iterator to iterate through either.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic