Skip to content

TCollectionEnumerator

[Properties (by Name)][Methods (by Name)][Events (by Name)]

Implements IEnumerator for the TCollection class.

Declaration

Source position: classesh.inc line 508

Type
  TCollectionEnumerator = class
  private
    FCollection : TCollection;
    FPosition : Integer;
  public
    constructor Create(ACollection: TCollection);
    function GetCurrent : TCollectionItem;
    function MoveNext : Boolean;
    Current : TCollectionItem;
  end
  ;

Description

TCollectionEnumerator implements the #rtl.system.IEnumerator interface for the TCollection class, so the TCollection class can be used in a for ... in loop. It is returned by the TCollection.GetEnumerator method of TCollection.

Members

Member Type Visibility Description
Create Method public Initialize a new instance of TCollectionEnumerator
Current Property public Current pointer in the list
FCollection Field private
FPosition Field private
GetCurrent Method public Return the current pointer in the list
MoveNext Method public Move the position of the enumerator to the next position in the collection.

Inheritance

Class Description
TCollectionEnumerator Implements IEnumerator for the TCollection class.

See also

Name Description
Integer A signed 16-bits integer
#rtl.system.IEnumerator Enumerator support interface
TCollection Base class to manage collections of named objects.
TCollection Base class to manage collections of named objects.
TCollection.GetEnumerator Create an IEnumerator instance
TCollectionItem Basic object that is managed by a TCollection class.