Can you use Strings as 'values' in a hashtable?

Reply

Join Date: Oct 2009
Posts: 10
Reputation: skiplatte is an unknown quantity at this point 
Solved Threads: 0
skiplatte skiplatte is offline Offline
Newbie Poster

Can you use Strings as 'values' in a hashtable?

 
0
  #1
30 Days Ago
Pretty much what the title says!! Basically I want to store method generated Strings and then plug them into another method - would hashtable be a way to do this??

Thanks
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,358
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 252
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven
 
0
  #2
30 Days Ago
Strings can, of course be values in a hastable, but what does that have to do with the rest of the question?

What do you mean by "method generated Strings" and "plug them into another method"?

Also, whatever it is, HashMap would probably be a better choice than Hashtable, unless you have some specific reason for synchronizing access to it.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,358
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 252
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven
 
0
  #3
30 Days Ago
Strings can, of course be values in a hastable, but what does that have to do with the rest of the question?

What do you mean by "method generated Strings" and "plug them into another method"?

Also, whatever it is, HashMap would probably be a better choice than Hashtable, unless you have some specific reason for synchronizing access to it.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 10
Reputation: skiplatte is an unknown quantity at this point 
Solved Threads: 0
skiplatte skiplatte is offline Offline
Newbie Poster
 
0
  #4
30 Days Ago
Originally Posted by masijade View Post
Strings can, of course be values in a hastable, but what does that have to do with the rest of the question?

What do you mean by "method generated Strings" and "plug them into another method"?

Also, whatever it is, HashMap would probably be a better choice than Hashtable, unless you have some specific reason for synchronizing access to it.
Basically I have a method (tokenizer, but thinking about looking at regex) which splits an input string into smaller strings are r and k and i want to be able to used those substrings to calculate the mass of them (from values stored in a hashmap). So probably thinking about it I'll need to make an array of substrings?

Thanks
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,358
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 252
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven
 
0
  #5
25 Days Ago
I have no idea what you are talking about.

Maybe you should provide a bit of a sample of the data you start with and then a detailed explanation of what you are doing with it (showing the modifications to that data).
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC