Working with Lists

From RAD Studio
Jump to: navigation, search

Go Up to RTL

The RTL includes many classes that represent lists or collections of items. The lists vary depending on the types of items they contain, the operations they support, and whether they are persistent.

The following table lists various list classes, and indicates the types of items they contain:

Object Maintains

System.Classes.TList

A list of pointers

System.Classes.TThreadList

A thread-safe list of pointers

System.Contnrs.TBucketList

A hashed list of pointers

System.Contnrs.TObjectBucketList

A hashed list of object instances

System.Contnrs.TObjectList

A memory-managed list of object instances

System.Contnrs.TComponentList

A memory-managed list of components (that is, instances of classes descended from TComponent)

System.Contnrs.TClassList

A list of class references

Classes.TInterfaceList

A list of interface pointers.

System.Contnrs.TQueue

A first-in first-out list of pointers

System.Contnrs.TStack

A last-in first-out list of pointers

System.Contnrs.TObjectQueue

A first-in first-out list of objects

System.Contnrs.TObjectStack

A last-in first-out list of objects

Classes.TCollection

Base class for many specialized classes of typed items.

Classes.TStringList

A list of strings

System.IniFiles.THashedStringList

A list of strings with the form Name=Value, hashed for performance.

System.Generics.Collections.TArray

Class that contains static methods for searching and sorting a generic array.

System.Generics.Collections.TDictionary

Collection of key-value pairs.

System.Generics.Collections.TEnumerable

TEnumerable is an abstract class inherited by all enumerable containers.

System.Generics.Collections.TEnumerator

TEnumerator is an abstract class implemented by all enumerator classes.

System.Generics.Collections.TList

Ordered list.

System.Generics.Collections.TObjectDictionary

Collection of key and/or value objects.

System.Generics.Collections.TObjectList

Ordered list of objects.

System.Generics.Collections.TObjectQueue

Queue of objects.

System.Generics.Collections.TObjectStack

Last in, first out stack of objects.

System.Generics.Collections.TQueue

Queue implemented over array, using wrapping.

System.Generics.Collections.TStack

Last in, first out stack.

System.Generics.Collections.TThreadedQueue

Represents a generic threaded queue.

System.Generics.Collections.TThreadList

Represents a generic thread-safe list.

Note: The System.Generics.Collection classes use a growing strategy implemented by System.SysUtils.GrowCollection.

Topics

See Also