⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.ttt

📁 Delphi高级开发指南是开发程序的好帮手
💻 TTT
字号:
unit Unit1;

interface

uses
  Classes;

type
  TTTList = class(TObject)
  private
    FList: TList;
    function Get(Index: Integer): TTT;
    procedure Put(Index: Integer; Item: TTT);
    function GetCount: Integer;
  public
    constructor Create;
    destructor Destroy; override;
    function Add(Item: TTT): Integer;
    function Equals(List: TTTList): Boolean;
    property Count: Integer
      read GetCount;
    property Items[Index: Integer]: TTT
      read Get write Put; default;
  end;

implementation

constructor TTTList.Create;
begin
  inherited Create;
  FList := TList.Create;
end;

destructor TTTList.Destroy;
begin
  FList.Free;
  inherited Destroy;
end;

function TTTList.Get(Index: Integer): TTT;
begin
  Result := FList[Index];
end;

procedure TTTList.Put(Index: Integer; Item: TTT);
begin
  FList[Index] := Item;
end;

function TTTList.GetCount: Integer;
begin
  Result := FList.Count;
end;

function TTTList.Add(Item: TTT): Integer;
begin
  Result := FList.Add(Item);
end;

function TTTList.Equals(List: TTTList): Boolean;
var
  I: Integer;
begin
  Result := False;
  if List.Count <> FList.Count then
    Exit;
  for I := 0 to List.Count - 1 do
    if List[I] <> FList[I] then
      Exit;
  Result := True;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -