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

Represents a container that offers up two kinds of iterators for the hardcoded contents. More...

Collaboration diagram for IteratorContainer_Class:
Collaboration graph

Public Member Functions

IIterator< ItemPairGetItems ()
 Retrieve an iterator over the data that returns an ItemPair object containing both key and value for each entry.
 
IIterator< string > GetKeys ()
 Retrieve an iterator over the "key" part of the data, where the data returned from the iterator is a string type.
 
IIterator< string > GetValues ()
 Retrieve an iterator over the "value" part of the data, where the data returned from the iterator is a string type.
 

Private Attributes

string[] _keys = new string[] { "One", "Two", "Three" }
 
string[] _values = new string[] { "Value 1", "Value 2", "Value 3" }
 

Detailed Description

Represents a container that offers up two kinds of iterators for the hardcoded contents.

Definition at line 142 of file IteratorContainer_Class.cs.

Member Function Documentation

◆ GetItems()

IIterator< ItemPair > GetItems ( )
inline

Retrieve an iterator over the data that returns an ItemPair object containing both key and value for each entry.

Returns
An IIterator object for getting ItemPair objects.

Definition at line 157 of file IteratorContainer_Class.cs.

References IteratorContainer_Class._keys, and IteratorContainer_Class._values.

Referenced by Iterator_Exercise.Run().

◆ GetKeys()

IIterator< string > GetKeys ( )
inline

Retrieve an iterator over the "key" part of the data, where the data returned from the iterator is a string type.

Returns
An IIterator object for getting strings.

Definition at line 177 of file IteratorContainer_Class.cs.

References IteratorContainer_Class._keys.

Referenced by Iterator_Exercise.Run().

◆ GetValues()

IIterator< string > GetValues ( )
inline

Retrieve an iterator over the "value" part of the data, where the data returned from the iterator is a string type.

Returns
An IIterator object for getting strings.

Definition at line 187 of file IteratorContainer_Class.cs.

References IteratorContainer_Class._values.

Referenced by Iterator_Exercise.Run().

Member Data Documentation

◆ _keys

string [] _keys = new string[] { "One", "Two", "Three" }
private

◆ _values

string [] _values = new string[] { "Value 1", "Value 2", "Value 3" }
private

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