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
Post a Comment