Problems getting value from map
I want to retrieve the value from a hashmap corresponding to some key, but I have some problems getting it working.
Based on what I've seen in several examples, I'd say that something like this would do it:
What I want to express is the following:
int nGramCount = 1;
int newnGramCount = 0;
// System.out.println("This is the nGram: " + nGram);
newnGramCount = nGramMap.getValue(nGram);
I'm looping through some strings, put these strings in a map and assign them a count. So if I bump into some string that is not already in the map, stuff it there and assign it the nGramCount. If the string already is in the map, the count of that string/key should be raised. So I look up the value of this string/key, add 1 to it, and then want to put it back in there.
The error message I get:
The method getValue(String) is undefined for the type HashMap<String,Integer>
Help is much appreciated!