uw25132.pp 423 B

1234567891011121314151617181920212223242526272829
  1. unit uw25132;
  2. {$ifdef fpc}
  3. {$mode delphi}
  4. {$endif}
  5. interface
  6. type
  7. TIterator<TElement> = class(TObject)
  8. public
  9. function GetValue(): Integer; virtual; abstract;
  10. end;
  11. TCollectionIterator = class(TIterator<TObject>)
  12. public
  13. function GetValue(): Integer; override;
  14. end;
  15. implementation
  16. { TCollectionIterator }
  17. function TCollectionIterator.GetValue(): Integer;
  18. begin
  19. Result := 1;
  20. end;
  21. end.