System.Generics.Collections.TObjectList.Create

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

constructor Create(AOwnsObjects: Boolean = True); overload;
constructor Create(const AComparer: IComparer<T>; AOwnsObjects: Boolean = True); overload;
constructor Create(const Collection: TEnumerable<T>; AOwnsObjects: Boolean = True); overload;

C++

__fastcall TObjectList__1(bool AOwnsObjects)/* overload */;
__fastcall TObjectList__1(const System::DelphiInterface<System::Generics::Defaults::IComparer__1<T> > AComparer, bool AOwnsObjects)/* overload */;
__fastcall TObjectList__1(TEnumerable__1<T>* const Collection, bool AOwnsObjects)/* overload */;
/* {System_Generics_Collections}TList<System_Generics_Collections_TObjectList<T>_T>.Create */ inline __fastcall TObjectList__1(void)/* overload */ : TList__1<T>() { }
/* {System_Generics_Collections}TList<System_Generics_Collections_TObjectList<T>_T>.Create */ inline __fastcall TObjectList__1(const System::DelphiInterface<System::Generics::Defaults::IComparer__1<T> > AComparer)/* overload */ : TList__1<T>(AComparer) { }
/* {System_Generics_Collections}TList<System_Generics_Collections_TObjectList<T>_T>.Create */ inline __fastcall TObjectList__1(TEnumerable__1<T>* const Collection)/* overload */ : TList__1<T>(Collection) { }

Properties

Type Visibility Source Unit Parent
constructor public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TObjectList

Description

Create TObjectList instance.

This overloaded method creates a TObjectList instance.

The AOwnsObjects parameter is a boolean that indicates whether object entries are owned by the list. If the object is owned, when the entry is removed from the list, the object is freed. The OwnsObjects property is set from the value of this parameter. The default is true.

Collection is a collection with which to initialize the list. The objects are added in the same order as in Collection. If Collection is specified, the creation is an O(n) operation, where n is the number of items in Collection.

AComparer is an equality comparator function. If not provided, the default comparator for the type is used.

See Also