java - check String contains inside HashTable Value -


1=[fletcher christian, no, visualisation of egocentric networks, exploring irish political landscape on twitter, twitter network analysis, web-based server energy model generator, recommending movies using curated imdb lists, travel planner commuters, analysis of urban street networks - constructing dual representation, biography reading media assistant] 

i have hash-table above.i want find whether fletcher christian contained inside hash-table value

here value vector

simply go on values , check :

static boolean contains (hashtable <integer, vector <string>> map, string value){     (vector<string> values : map.values()){         if (values.contains(value))             return true;     }     return false; } 

in java 8 can single row:

static boolean contains (hashtable <integer, vector<string>> map, string value){     return map.values().stream().anymatch(list -> list.contains(value)); } 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -