我在Delphi中创建自己的数据结构。
顺便说一句,我遇到了一个问题,即在record
和class
之间使用字典作为值。
这是我的代码。
TContinuousItem = Record
Count: Integer;
Order: Integer;
ContractTime: String;
end;
...
var
FItems: TDictionary<Integer, TContinuousItem>;
以下是使用课程。
TContinuousItem = class(TObject)
private
FCount: Integer;
FOrder: Integer;
FContractTime: String;
public
property Count: String read FCount;
property Order: String read FOrder;
property ContractTime: String read FContractTime;
constructor Create(const count, order: Integer; const contractTime: String);
end;
...
var
FItems: TObjectDictionary<Integer, TContinuousITem>;
要求:
order
/ record
class
值排序
哪种方式更好用?什么更正确?