referring a unknown object in its subclass
I am still quite new to java. So this maybe stupid, but I can't get over it. I am trying to override a method and a constructor from a class (HashMap). My problem is the following:
In my constructor, I have a super(Map M) that take an argument M to call the constructor of HashMap(Map M). This superclass will use this M and create a hashmap. Now in my constructor, I want to copy this hashmap to a buffer. So I used:
HashMap Mbuf = new HashMap();
Mbuf = super.putAll(???);
then I don't know what to put in the argument of super.putAll(). It should be the hashmap created by the super(M) function, but I don't know how to reference it. I keep having trouble to referring this newly created hashmap. Is there any way to get over it.
The reason I try to do this is that I would like to verify the map M has no duplicate values nor key, i.e. 1-1 mapping. And if there are some duplicated values, the constructor will eliminate them.