J
Jeff Stewart
I have a Stats class derived from HashTable that I want to be cloneable.
But I can't figure out how to override the Clone() method. How do I return
a new Stats object with the same internal hash table as the source object?
All I want is a shallow copy. The best I can come up with is this, but it
seems like a lot of trouble:
public overrides function Clone() as Object
dim returnObj as new Stats = new Stats()
' Insert code to copy each element (shallow only!) of this object's
hashtable to returnObj hashtable
' ...
return returnObj
end function
But I can't figure out how to override the Clone() method. How do I return
a new Stats object with the same internal hash table as the source object?
All I want is a shallow copy. The best I can come up with is this, but it
seems like a lot of trouble:
public overrides function Clone() as Object
dim returnObj as new Stats = new Stats()
' Insert code to copy each element (shallow only!) of this object's
hashtable to returnObj hashtable
' ...
return returnObj
end function