-
Notifications
You must be signed in to change notification settings - Fork 5
/
StnColl.pas
69 lines (48 loc) · 1.36 KB
/
StnColl.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//------------------------------------------------------------------------------
//This Source Code Form is subject to the terms of the Mozilla Public
//License, v. 2.0. If a copy of the MPL was not distributed with this
//file, You can obtain one at http://mozilla.org/MPL/2.0/.
//------------------------------------------------------------------------------
unit StnColl;
interface
uses
SysUtils, Classes, Station, DxStn, QrnStn, QrmStn;
type
TStations = class(TCollection)
private
function GetItem(Index: Integer): TStation;
public
constructor Create;
//destructor Destroy; override;
function AddCaller: TStation;
function AddQrn: TStation;
function AddQrm: TStation;
property Items[Index: Integer]: TStation read GetItem; default;
end;
implementation
{ TCallerCollection }
{ TStations }
constructor TStations.Create;
begin
inherited Create(TStation);
end;
function TStations.GetItem(Index: Integer): TStation;
begin
Result := (inherited GetItem(Index)) as TStation;
end;
function TStations.AddCaller: TStation;
begin
Result := TDxStation.CreateStation;
Result.Collection := Self;
end;
function TStations.AddQrn: TStation;
begin
Result := TQrnStation.CreateStation;
Result.Collection := Self;
end;
function TStations.AddQrm: TStation;
begin
Result := TQrmStation.CreateStation;
Result.Collection := Self;
end;
end.