Hey guys,
I was just wondering if there was a Concrete Class implementation (and or a modification that can be made of the TreeMap class) so that it can only contain a fixed number of 'keys' ?
Cheers,
David
Printable View
Hey guys,
I was just wondering if there was a Concrete Class implementation (and or a modification that can be made of the TreeMap class) so that it can only contain a fixed number of 'keys' ?
Cheers,
David
Simple modification using size()
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
Your p.s. is exactly what i was referring to, but use >= instead of ==
Your choice whether to use delegation or inheritance.
[SOLVED]
Hey OrangeDog, yeah I assumed as much.
Thanks for the advice,
David