websocket node:容器集合之TCollection 和 TCollectionItem
来源:百度文库 编辑:中财网 时间:2024/05/09 15:45:48
TCollection继承于: TObject--TPersistent, 存储TCollectionItem对象的容器.
TCollectionItem继承于: TObject--TPersistent, 表示集合中一个Item.
他们的子类具有对应的关系,如下图所示:
集合类(Tcollection)对应的Item类(TCollectionItem)相关的组件Component
TAggregatesTAggregateTClientDataSet
TCookieCollectionTCookieTWebResponse
TCoolBandsTCoolBandTCoolBar
TDBGridColumnsTColumnTDBGrid
TDependenciesTDependencyTService
TDisplayDimsTDisplayDimTDecisionGrid
TFieldDefsTFieldDefTDataSet
THeaderSectionsTHeaderSectionTHeaderControl
TIndexDefsTIndexDefTTable
TListColumnsTListColumnTListView
TParamsTParammany datasets
TStatusPanelsTStatusPanelTStatusBar
TWorkAreasTWorkAreaTListView
(一) TCollection
属性:
1. property Count: Integer;
Item 的个数; 只读;
2. property ItemClass: TCollectionItemClass;
Item所属的类; 只读;
type TCollectionItemClass = class of TCollectionItem;
3. property Items[Index: Integer]: TCollectionItem;
按索引检索对应的 Item.
4. property NextID: Integer;
下一个将要加入集合中的Item的唯一ID; 只读;
5. property PropName: string;
属性名.
6. property UpdateCount: Integer;
调用了 BeginUpdate 而没有对应的调用 EndUpdate 的次数;只读;
方法:
1. function Add: TCollectionItem;
创建一个TCollectionItem实例并加入集合中.
2. procedure Assign(Source: TPersistent); override;
拷贝给另一份集合.
3. procedure BeginUpdate; virtual;
暂停屏幕刷新(加速处理,并避免增减Item时屏幕闪烁),直到 EndUpdate方法调用; 虚方法;
4. procedure Changed; Protected
在EndUpadte之后自动执行,以检查和更新字段内容.
5. procedure Clear;
删除所有的项;
6. procedure Delete(Index: Integer);
删除指定索引的 Item.
7. procedure EndUpdate; virtual;
重新屏幕刷新;
8. function FindItemID(ID: Integer): TCollectionItem;
根据ID检索对应的 Item.
9. function GetNamePath: string; override;
返回设计时使用的名字;
10. function Insert(Index: Integer): TCollectionItem;
插入1个 Item.
11. function Owner: TPersistent;
返回集合的操作者;
12. procedure SetItem(Index:Integer; Value: TCollectionItem);
copy 实例到 Index对应的Item中;
13. procedure Update(Item: TCollectionItem); virtual;
自动调用更新;
(二) TCollectionItem
属性:
1. property Collection: TCollection;
存放Item 的容器;
2. property DisplayName: string;
集合编辑器的名字;
3. property ID: Integer;
Item的 唯一 ID.
4. property Index: Integer;
Item在容器中的索引号.
方法:
1. function GetDisplayName: string; virtual;
返回集合编辑器的名称;
2. function GetOwner: TPersistent; override;
返回Item所属的集合;
TCollectionItem继承于: TObject--TPersistent, 表示集合中一个Item.
他们的子类具有对应的关系,如下图所示:
集合类(Tcollection)对应的Item类(TCollectionItem)相关的组件Component
TAggregatesTAggregateTClientDataSet
TCookieCollectionTCookieTWebResponse
TCoolBandsTCoolBandTCoolBar
TDBGridColumnsTColumnTDBGrid
TDependenciesTDependencyTService
TDisplayDimsTDisplayDimTDecisionGrid
TFieldDefsTFieldDefTDataSet
THeaderSectionsTHeaderSectionTHeaderControl
TIndexDefsTIndexDefTTable
TListColumnsTListColumnTListView
TParamsTParammany datasets
TStatusPanelsTStatusPanelTStatusBar
TWorkAreasTWorkAreaTListView
(一) TCollection
属性:
1. property Count: Integer;
Item 的个数; 只读;
2. property ItemClass: TCollectionItemClass;
Item所属的类; 只读;
type TCollectionItemClass = class of TCollectionItem;
3. property Items[Index: Integer]: TCollectionItem;
按索引检索对应的 Item.
4. property NextID: Integer;
下一个将要加入集合中的Item的唯一ID; 只读;
5. property PropName: string;
属性名.
6. property UpdateCount: Integer;
调用了 BeginUpdate 而没有对应的调用 EndUpdate 的次数;只读;
方法:
1. function Add: TCollectionItem;
创建一个TCollectionItem实例并加入集合中.
2. procedure Assign(Source: TPersistent); override;
拷贝给另一份集合.
3. procedure BeginUpdate; virtual;
暂停屏幕刷新(加速处理,并避免增减Item时屏幕闪烁),直到 EndUpdate方法调用; 虚方法;
4. procedure Changed; Protected
在EndUpadte之后自动执行,以检查和更新字段内容.
5. procedure Clear;
删除所有的项;
6. procedure Delete(Index: Integer);
删除指定索引的 Item.
7. procedure EndUpdate; virtual;
重新屏幕刷新;
8. function FindItemID(ID: Integer): TCollectionItem;
根据ID检索对应的 Item.
9. function GetNamePath: string; override;
返回设计时使用的名字;
10. function Insert(Index: Integer): TCollectionItem;
插入1个 Item.
11. function Owner: TPersistent;
返回集合的操作者;
12. procedure SetItem(Index:Integer; Value: TCollectionItem);
copy 实例到 Index对应的Item中;
13. procedure Update(Item: TCollectionItem); virtual;
自动调用更新;
(二) TCollectionItem
属性:
1. property Collection: TCollection;
存放Item 的容器;
2. property DisplayName: string;
集合编辑器的名字;
3. property ID: Integer;
Item的 唯一 ID.
4. property Index: Integer;
Item在容器中的索引号.
方法:
1. function GetDisplayName: string; virtual;
返回集合编辑器的名称;
2. function GetOwner: TPersistent; override;
返回Item所属的集合;
水和煤油对容器底的压强之比是多少?
关于排列组合和集合
关于排列组合和集合
集合........
集合{(3,-7)}和集合{(-7,3)}为什么不同?
java中容器类和部件类
体积相同的铅球和铁球,用线拴着投入煤油,不接触容器底,两线受拉力之比?若投入汽油中,比又是?
求圣魔之血29话啊T T!!
请问关于铝合金容器和铝制容器的的导热问题
逻辑题,如何用三升的容器和五升的容器量出四升的水
关于IE和T T!
质粒 核酸和酶的集合关系
集合的术语和符号有哪些
asp.net DataGrid控件之DataKeys集合问题;
番茄软件集合包--无雪之冬版[660M]
什么是T字之谜
H.O.T之最
用怎样的金属容器烹煮和储存酸性事物?
用怎样的金属容器烹煮和储存酸性食物
向VL真空容器内通入nmolSO2 和mmolH2S发生反应
数组的语义及运用——矢量和容器
rinsed bottle和keg都是什么容器啊?
开放式集合竞价和原来的集合竞价有何不同?
集合按元素个数可分为( )、( )和空集?空集是( )元素的集合?