posted 17 years ago
General code critique:
intValue() returns an int, not an Integer.
you are assigning the intValue() to an Integer,
it gets autoboxed, doing more work than needed,
the map contains Integers, get() will return an Integer
there is no reason for ++i, you never use i again, use +1
finally: if you want a mutable integer class, you can implement one, i don't think you need one - don't worry about "efficiency" until you're sitting around waiting on your code to execute
recoded:
fwiw, you are implementing a Bag semantic
[ January 23, 2008: Message edited by: Bill Shirley ]
[ January 23, 2008: Message edited by: Bill Shirley ]
Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);