德尔福哈希表? [英] delphi hashmap?

查看:15
本文介绍了德尔福哈希表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 java 代码从文本文件填充哈希图.
HashMap();

i have java-code filling a hashmap from a textfile.
HashMap<String, String[]> data = new HashMap<String, String[]>();

我用它来制作键值对.这些值是一个字符串数组.我必须遍历键值对的所有可能组合(因此还必须遍历字符串 [] 数组).这适用于java,但现在我必须将它移植到delphi.可以这样做吗?如何?谢谢!

i use this to make key-value-pairs. the values are an array of string. i have to iterate over every possible combo of the key-value-pairs (so also have to iterate over the String[]-array). This works with java but now i have to port this to delphi. is it possible to do so? and how? thanks!

推荐答案

在 Delphi 2009 及更高版本中,您可以通过 Generics.Collections 使用 TDictionary.

In Delphi 2009 and higher, you can use TDictionary<string, TStringlist> using Generics.Collections.

在旧版本中,您可以使用 TStringlist,其中 TStringlist 中的每个项目都有一个 TStrings 类型的关联对象值.

In older versions, you can use TStringlist where every item in the TStringlist has an associated object value of type TStrings.

Docwiki 有一个页面TDictionary 入门

The Docwiki has a page to get started with TDictionary

这篇关于德尔福哈希表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆