That would be kind of useful, actually. Although it is not too difficult to subclass the TMap and add the desired functionality yourself.
Something vaguely along the lines of :
type mymap extends tmap
field size:int
Method Clear()
Super.Clear()
size = 0
End Method
Method Insert( key:Object,value:Object )
if not Contains(key) size:+ 1
Super.Insert(key, value)
End Method
Method Remove( key:Object )
Super.Remove(key)
size:- 1
End Method
Method Count:Int()
return size
End Method
end type
... more or less.
|