Skip to content

TCollectionEnumerator

Implements IEnumerator for the TCollection class.

Declaration

Source position: classesh.inc line 903

type

  TCollectionEnumerator = class
  public
    constructor Create;
    function GetCurrent : TCollectionItem;
    function MoveNext : Boolean;
    property Current: TCollectionItem; {r}
  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.

Properties

Member Visibility Description
Current read only public Current pointer in the list.

Methods

Member Visibility Description
Create public Initialize a new instance of TCollectionEnumerator.
GetCurrent public Return the current pointer in the list.
MoveNext public Move the position of the enumerator to the next position in the collection.

See also

Name Description
TCollection Base class to manage collections of named objects.
TCollection.GetEnumerator Create an IEnumerator instance.
#rtl.system.IEnumerator Enumerator support interface.