Abstract classes, Interfaces, and Patterns
- slide 16 : 37
Sample use of IEnumerator and IEnumerable
The interface IEnumerator in
System.Collections
is used as the basis for iteration with
foreach
A reproduction of the interface IEnumerable.
A reproduction of the interface IEnumerator.
IEnumerator in the type Interval.
Iteration with and without foreach based on the enumerator.
The interface IEnumerator in System.Collections
The interface IEnumerable in System.Collections
The type Interval and overloaded operators
The iterator design pattern
The interface
IEnumerable
prescribes an operation GetEnumerator that returns an enumerator of type
IEnumerator