Results 1 to 5 of 5
Thread: TreeMaps
- 05-05-2009, 05:01 AM #1
Member
- Join Date
- Apr 2009
- Posts
- 49
- Rep Power
- 0
- 05-05-2009, 05:11 AM #2
Simple modification using size()
Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
- 05-05-2009, 05:16 AM #3
Member
- Join Date
- Apr 2009
- Posts
- 49
- Rep Power
- 0
Hey OrangeDog,
please correct me if I am wrong, but doesn't the size method simply return the number of keys in the TreeMap, I'm hoping to ensure that the a set value for the number of keys is imposed.
Thanks for your response.
David
ps - I guess a simple, modification to the add method could be used,
if( mytreemap.size == mydesignatednumber)
//do not add
- 05-05-2009, 05:26 AM #4
Your p.s. is exactly what i was referring to, but use >= instead of ==
Your choice whether to use delegation or inheritance.Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
- 05-05-2009, 05:47 AM #5
Member
- Join Date
- Apr 2009
- Posts
- 49
- Rep Power
- 0


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks