C
C Downey
Hello:
I have an arraylist storing some very basic objects.
The object is very basic, it has 2 properties : ID, and COUNT
Before I add an object to the arraylist, I want to check if an object with
that same ID already exists in the arraylist.
If it does, I would like to increase the count of the matching object inside
of the arraylist by 1, otherwise I want to add the new object.
How would I go about finding out if that object is already added in my
arraylist? And how would I increase the count?
Any advice and sample code would be greatly apreciated!
I have an arraylist storing some very basic objects.
The object is very basic, it has 2 properties : ID, and COUNT
Before I add an object to the arraylist, I want to check if an object with
that same ID already exists in the arraylist.
If it does, I would like to increase the count of the matching object inside
of the arraylist by 1, otherwise I want to add the new object.
How would I go about finding out if that object is already added in my
arraylist? And how would I increase the count?
Any advice and sample code would be greatly apreciated!