I have the following HashMap:
private HashMap<HashMap<Integer,String>,ArrayList<String>> unique_schemas = new HashMap<HashMap<Integer,String>,ArrayList<String>>(); I am having no problems adding entries to it or printing out its contents but I'm not sure how to check for an existing entry.
I have tried:
//create temp HashMap to check against HashMap<Integer,String> mapkey = new HashMap<Integer,String>(); //populate it with the values to check for mapkey.put(parentId,text); if (unique_schemas.containsKey(mapkey.get(0))) { //do whatever when the entry exists } This isn't working, I know it's wrong somewhere but I'm at a loss. Can anyone shed some light on my problem?
unique_schemaskey is aHashMap<Integer,String>, and you are comparing it betweenmapkey.get(0)which is aString.