Collection Classes
- slide 35 : 36
Making iterators with yield return
The
yield return
statement can be used to define iterators (enumerators) in an easy, high-level fashion
A collection of up to three instance variables of type T - with an iterator.
A sample iteration of the three instance variable collection.
The iterator behind a yield
The IntSequence Composite
The IntSequence Composite classes
The abstract class IntSequence - Revisited.
The class IntInterval - Revisited.
The class IntSingular - Revisited.
The class IntCompSeq - Revisited.
An application of the integer sequences.
Output of the integer sequence application program.
The AnimalFarm Collection
Animalfarm - GetGroup with yield return.
A sample client of AnimalFarm.
Program output.