This is a piece of the code where I am updating the HashMap:
if ( map.containsKey(temp))
{
// get MyData
MyDataTmp = (DSNdata)map.get(temp);
if( tempAction.equalsIgnoreCase("alias"))
{
MyDataTmp.putAlias("Y");
}
else if( tempAction.equalsIgnoreCase("load"))
{
MyDataTmp.putLoad("Y");
}
// delete the key and re add it
map.remove(temp);
map.put(temp, MyDataTmp);
}
This is where I am trying to "print" the hashmap:
out.println(map.size());
// Iterate over the keys in the map
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
// Get key
Object Key = it.next();
System.out.println(Key);
System.out.println("Hi");
}
// Iterate over the values in the map
it = map.values().iterator();
while (it.hasNext()) {
// Get value
Object Value = it.next();
System.out.println(Value);
System.out.println("Hi");
}
The println(map.size()) returns a number that is changing based on the
amout of data being processed by the form. This number does change
based on the amount of data that is being sent to it.
Can anyone help here? I added the "Hi" to the loop to see if it even
is going into the loop, and it dosent, so I would assume that the
hasNext() is returning false.
Thanks is advance for help,
Doug
The biggest recommendation I have for you is to get and use a good IDE
with a debugger. That will let you see where you are going wrong. I
and many others strongly prefer IntelliJ IDEA, but it costs money
(after the eval runs out, that is). They have a beta program which
will let you use their software until it is released, but you have to
put up with the fact that they are changing the problem relatively
often.
Eclipse is the other major contender and is free. I last tried it
quite some time ago and got a bad taste. Presumably it is massively
better now.