Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best data storage method

 
saddsada dsdasda
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, iv just got a simple problem what would be the best method for storing this type of data

list of words followed by a list of files the word is contained in e.g

"hello" ["a.txt","b.txt","c.txt"]
"ok" ["b.txt","d.txt"]
"yes" ["a.txt","b.txt"]

would i use hashset -hashmap or is it possible with arraylist

which i wish to add to this list when i find another word contained in a file so if the word is new then it gets added otherwise if i word contained in a file such as "ok" in "f.txt" it becomes

"hello" ["a.txt","b.txt","c.txt"]
"ok" ["b.txt","d.txt","f.txt"]
"yes" ["a.txt","b.txt"]



cheers in advance
 
Bimal Patel
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think HashMap is a better solution. BTW, your nickname is not proper according to JavaRanch standards .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic