Iterator Pattern

  • Client
    • Keeps a Collection object and uses a foreach statement to iterate over it
  • IEnumerable
    • A defined interface in C# for the operation GetEnumerator
  • Collection
    • A data type containing or having the ability to generate a collection of values
  • GetEnumerator
    • A method that supplies the values in sequence
  • OtherOps
    • Other methods that supply Collection values in different sequences with different filters and transformations