Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

how to compare map value to map'innner map key with minimum loop iteration

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Traverse

Map<Map<String_input, List<String>>,List<String_output>> bigmap;
I like to compare the value of String_output with String_input;

String_output is a list contains multiple values.

String_input is a key of map.

output of this map is

out put of this map:-{{_drop=[She dropped into army jargon.,_drop]}=[shed,cast,cast off,shake off,drop]}

String_input is -> _drop. String_output is -> [shed,cast,cast off,shake off,drop].

i want to compare String_input with String_output. please help me out.




if you have any idea using recurssion. I appreciate.

please help me out.




Myquestion is i want to compare the value of valueofBigMap key to innerMapk. as bigmap has multiple items. each item should compare with valueofBigMap.
sample code.








 
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

OK let me try to understand the collection:
The key is strin=>[str1, str2, ...]
The value is [strout1, strout2, ...]

And you want to "strin" and the value "[strout1, strout2, ...]"?

Looking at this why not just have a "simpler" map eg Map<String_input, List<String_output>>??

 
K. Tsang
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using your Map<Map<String, List<String>>, List<String>> you can iterate a map like:

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic