关于Delphi中的集合类型比如类似JAVA中的HashMap在哪里?

一般都在System.Generics.Collections 命名空间下, Delphi2009以上就有了

有如下常用实用的泛型实现类:

TList<T> = class(TEnumerable<T>)

TQueue<T> = class(TEnumerable<T>)

TObjectQueue<T: class> = class(TQueue<T>)

TStack<T> = class(TEnumerable<T>)

TObjectStack<T: class> = class(TStack<T>)

TDictionary<TKey,TValue> = class(TEnumerable<TPair<TKey,TValue>>)

TThreadList<T> = class

TThreadedQueue<T> = class

基本涵盖了列表,队列,栈,map,线程列表等,具体是否线程安全的,还没细看

最常用的TDictionary键值对泛型用法:TDictionary<Key,Value>;

smap:TDictionary<String,String>;
imap:TDictionary<Integer,Integer>;
somap:TDictionary<String,TObject>;
OOmap:TDictionary<TObject,TObject>;

 

posted @   IT情深  阅读(61)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 我与微信审核的“相爱相杀”看个人小程序副业
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· spring官宣接入deepseek,真的太香了~
点击右上角即可分享
微信分享提示