×

VB.Net基本教程

VB.Net 环境设置VB.Net 程序结构VB.Net 基本语法VB.Net 数据类型VB.Net 变量VB.Net 常数和枚举VB.Net 修饰符VB.Net 声明VB.Net 指令VB.Net 运算符VB.Net 决策VB.Net 循环VB.Net 字符串VB.Net 日期和时间VB.Net 数组VB.Net 集合VB.Net 函数VB.Net Sub过程(子程序)VB.Net 类与对象VB.Net 异常处理VB.Net 文件处理VB.Net 基本控制VB.Net 对话框VB.Net 高级表单VB.Net 事件处理

VB.Net 高级教程

VB.Net 正则表达式VB.Net 数据库访问VB.Net Excel工作表VB.Net 发送邮件VB.Net XML处理VB.Net Web编程

VB.Net 有用的资源

VB.Net 有用资源

VB.Net 集合


集合类是用于数据存储和检索的专用类。 这些类提供对堆栈,队列,列表和哈希表的支持。 大多数集合类实现相同的接口。


集合类用于各种目的,例如动态地为元素分配内存以及基于索引访问项目列表等。这些类创建Object类的对象集合,Object类是VB中所有数据类型的基类 。


各种集合类和它们的用法

以下是System.Collection命名空间的各种常用类。 单击以下链接以检查其详细信息。


Class Description and Useage

ArrayList

It represents ordered collection of an object that can be indexedindividually.

它表示可以单独索引的对象的有序集合。

It is basically an alternative to an array. However, unlike array, you can add and remove items from a list at a specified position using anindex and the array resizes itself automatically. It also allows dynamic memory allocation, add, search and sort items in the list.

它基本上是一个数组的替代。 但是,与数组不同,您可以使用索引在指定位置从列表中添加和删除项目,并且数组会自动调整大小。 它还允许动态内存分配,添加,搜索和排序列表中的项目。

Hashtable

It uses a key to access the elements in the collection.

它使用一个键来访问集合中的元素。

A hash table is used when you need to access elements by using key, and you can identify a useful key value. Each item in the hash table has a key/value pair. The key is used to access the items in the collection.

当您需要通过使用键访问元素时使用散列表,您可以标识有用的键值。 散列表中的每个项都有一个键/值对。 该键用于访问集合中的项目。

SortedList

It uses a key as well as an index to access the items in a list.

它使用一个密钥以及索引来访问列表中的项目。

A sorted list is a combination of an array and a hash table. It contains a list of items that can be accessed using a key or an index. If you access items using an index, it is an ArrayList, and if you access items using a key, it is a Hashtable. The collection of items is always sorted by the key value.

排序列表数组组合包含可以使用索引访问列表如果访问使用索引项目一个 ArrayList如果访问项目使用钥匙一个哈希表集合总是关键排序

Stack

It represents a last-in, first out collection of object.

它表示对象的后进先出的集合。

It is used when you need a last-in, first-out access of items. When you add an item in the list, it is called pushing the item, and when you remove it, it is calledpopping the item.

当您需要项目的最后进入,首先访问时使用。 当您在列表中添加项目时,称为推送项目,当您删除它时,它被称为弹出项目。

Queue

It represents a first-in, first out collection of object.

它表示对象的先进先出集合。

It is used when you need a first-in, first-out access of items. When you add an item in the list, it is called enqueue, and when you remove an item, it is called deque.

当您需要项目的先进先出访问时使用。 当您在列表中添加项目时,它被称为enqueue,当您删除项目时,称为deque。

BitArray

It represents an array of the binary representation using the values 1 and 0.

它表示使用值1和0的二进制表示的数组。

It is used when you need to store the bits but do not know the number of bits in advance. You can access items from the BitArray collection by using an integer index, which starts from zero.

它用于需要存储位但不提前知道位数。 您可以通过使用从零开始的整数索引来访问BitArray集合中的项目。


分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)