Add this code to the end of the iterator loop
将下列代码添加到迭代器循环的底部
Create an iterator to iterate through the collection.
创建一个迭代器,以便通过集合进行迭代。
Basically, an iterator is an object that has a.next method.
基本上,迭代器是含有. next方法的对象。
Part 2 will take a more in-depth look at the event iterator API.
第2部分将深入讨论事件迭代器api。
The main problem is that we create a new copy of the iterator every time.
主要问题是,每次都要创建迭代器的一个新副本。
Returns the range size of the iterator.
获得迭代器的范围大小。
Such is the case with the iterator pattern.
这个例子类似于迭代器模式。
Is manually updating a for loop iterator bad practice?
手动更新循环迭代器不好的做法?
The concept of an iterator range is fundamental to the standard library.
迭代器范围这个概念是标准库的基础。
With enough contortions, you can get an item for every type of sequence/iterator.
对于每种序列/迭代器类型,只要费一番功夫,总能够获得其中的特定条目。
Part 2 of this series will provide a detailed description of the event iterator-based API.
本系列的第二部分将详细讨论这种基于事件迭代器的API。
The second block, which uses an Iterator instead, should perform faster than the first.
第二个代码块使用的是 Iterator,应该比第一块执行得快一些。
The second block, which uses an Iterator instead, should perform faster than the first.
第二个代码块使用的是 Iterator,应该比第一块执行得快一些。
应用推荐