I have a file which has a key and value. The key can be formed of just a name or name_locationIndia = 1Delhi_1 = 20.40US = 43.2Raleigh_20 = 240.23Seattle_20 = 34.30Raleigh = 100.23Seattle = 40.34I want to create a map which has these values. For this I am doing a lazy read as and when required. When I am requested a value, I am always given a Location name and location id. If the a value exists in a file which has the location along with their id, that value is given preference. If there is no name with location id, read the value with only location.Map<String, MyTableValue> myMap;public MyTableValue getValue(String name, int location) {    MyTableValue value_withLocation = myMap.get(String.format(%s%d, name, location));    MyTableValue value_withNoLocation = myMap.get(name);    if(value_withLocation) {        return value_withLocation;    }    //Do not return value_withNoLocation immediately as we still need to see     //if it exists in the file.    ParsedValue parsedValue_withLocation = parseFile(name, location);    ParsedValue parsedValue_withoutLocation = parseFile(name);    if(parsedValue_withLocation) {        MyTableValue myTableValue = new                              MyTableValue(parsedValue_withLocation);        myMap.put(String.format(%s%d, myTableValue));        return myTableValue;    } else if(!value_withNoLocation){        MyTableValue myTableValue = new                             MyTableValue(parsedValue_withoutLocation);        myMap.put(String.format(%s%d, myTableValue));        return myTableValue;    } else {        return value_withNoLocation;    }}I wanted to get some feedback, and know if there is a better way to approach this. 
Lazy storing of values in Hashmap, better approach
java;hash map