I realize a simple way would be to store the event listener reference on the element itself, but I wonderif modifying the type of the element is going to cause extra performance issues?
为了与一些硬件同步,我创建了一个包含通用类DataField的数据模型,用于在HashMap中存储不同类型的对象。HashMap myDictionary. 现在我发现,如果我将DataField存储到DataField中,就可以在DataField中保存一个字符串。有没有办法防止这种情况发生。 以下是我的代码: public class DataField<T> implements IDataField<T> { private T _value;