• Post Reply Bookmark Topic Watch Topic
  • New Topic

Map Key Add up issue  RSS feed

 
Keith Anderson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Help !!!
----------
I have a class I have created, It is designed to look for duplicate keys in a map. and add up the key values.
As you can see the second key it finds is not a duplicate.
Also it add the total of key 106 with the total of the second key 107.
Just from looking at the results, I see it adding two keys that are right next to each other.
what am I doing wrong?
----------



Input TXT file
===========
110001 commercial 500000.00 101
110223 residential 100000.00 101
110020 commercial 1000000.00 107
110333 land 30000.00 105
110442 farm 200000.00 106
110421 land 40000.00 107
112352 residential 250000.00 110




Console Output
===========
Duplicate key found 101
Current Land Value String500000.00
Current Land Value Double 500000.0
Total Land Value Object100000.00
Total Land Value String 100000.00
Total Land Value100000.0
again 600000.0
Duplicate key found 106
Current Land Value String200000.00
Current Land Value Double 200000.0
Total Land Value Object40000.00
Total Land Value String 40000.00
Total Land Value40000.0
again 240000.0
 
Keith Anderson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I got it LOL..
like less than a min after I posted.
=========



 
Keith Anderson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the else portion of my class, I did have it pull the new Agent ID or new Value.
So when I went to print these values, it of course used the old value.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!