Design Pattern Examples
Overview of object-oriented design patterns
Iterator_Exercise Class Reference

Example of using the Iterator Pattern in C#. More...

Collaboration diagram for Iterator_Exercise:
Collaboration graph

Public Member Functions

void Run ()
 Executes the example for the Iterator Pattern in C#.
 

Detailed Description

Example of using the Iterator Pattern in C#.

A custom container is instantiated (it already contains harcoded data to iterate over). The custom container can then deliver three iterators, each providing a different aspect of the hardcoded data.

The output shows the output from each iterator.

Definition at line 23 of file Iterator_Exercise.cs.

Member Function Documentation

◆ Run()

void Run ( )
inline

Executes the example for the Iterator Pattern in C#.

Definition at line 29 of file Iterator_Exercise.cs.

References IteratorContainer_Class.GetItems(), IteratorContainer_Class.GetKeys(), and IteratorContainer_Class.GetValues().

Referenced by Program.Run().


The documentation for this class was generated from the following file: