Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
提供一种方式,用于遍历容器内的元素,而不暴露容器的底层表示。
for each),用于遍历不同容器。Iterator) CurrentItem()) 和遍历 (First(), Next(), Done()) 元素的接口。ConcreteIterator) Container) CreateIterator())。ConcreteContainer)