We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › definition app, best approach
Page Index Toggle Pages: 1
definition app, best approach (Read 332 times)
definition app, best approach
Feb 2nd, 2009, 4:21pm
 
I'm making a dictionary applet that has around 690 entries, I was thinking that the most efficient method would be to load the definitions into an array.

Is there a better approach?
I think that using an external text file will not work too well, this is an applet for mobile.processing
Re: definition app, best approach
Reply #1 - Feb 2nd, 2009, 4:40pm
 
does mobile.processing have hashmaps?
Re: definition app, best approach
Reply #2 - Feb 2nd, 2009, 6:01pm
 
I think so, I found this post in the forum:

"Seems like I have to use java.util.Hashtable instead. Would be nice if hashes where a part of processing."

I am unfamiliar with "hashmaps", I will look into this term some more
Re: definition app, best approach
Reply #3 - Feb 2nd, 2009, 6:20pm
 
looks like the hashtable will work
I found some java examples that worked, and it seems like a much more clean-cut method than using arrays would be

thanks koogs
Re: definition app, best approach
Reply #4 - Feb 3rd, 2009, 1:03am
 
HashMap is the modern cousin of old, slightly obsolete Hashtable.

And about your quote: Processing supports hashes, and all Java collections. Not as easily as JavaScript or PHP does, but still efficiently.
Page Index Toggle Pages: 1