NET.GenericClass 类
命名空间: NET
表示参数化泛型类型定义
描述
NET.createGeneric
函数使用此类的实例创建泛型特化实例,此操作要求用另一参数化类型进行参数化。
创建对象
genType
= NET.GenericClass(className
,paramTypes
)
输入参数
className
— 泛型类型名称
字符串 | 字符向量
完全限定的泛型类型名称,指定为字符串或字符向量。
paramTypes
— 参数类型
字符串 | 字符向量 | NET.GenericClass
泛型类参数化的参数类型 1 到 N(如果有),指定为:
字符串或字符向量,其中包含完全限定的泛型类型名称。
NET.GenericClass
类实例(需要使用另一参数化类型进行更深层次的嵌套参数化时)。
示例
System.Collections.Generic.List
创建一个 System.Collections.Generic.KeyValuePair
泛型关联的 System.Collections.Generic.List
实例,其中 Key
是 System.Int32
类型,Value
是初始存储容量为 10 个键-值对的 System.String
。
kvpType = NET.GenericClass(... 'System.Collections.Generic.KeyValuePair',... 'System.Int32', 'System.String'); kvpList = NET.createGeneric('System.Collections.Generic.List',... {kvpType}, 10);
版本历史记录
在 R2009a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)