这个变量应该有自己的类型,这样,它就可以与将遍历的列表、数组或集合中的每一个项兼容。
This variable should be typed so that it's compatible with each item in the list, array, or collection being iterated over.
集合框架引入了迭代器,用于遍历一个列表或者其他集合,从而优化了对一个集合中的元素进行迭代的过程。
The Collections framework introduced iterators for traversing a list or other collection, which optimizes the process of iterating through the elements in a collection.
现在可以很轻松地遍历这个集合并在一个列表中输出每个单元格的内容。
It's now quite easy to iterate over the collection and print the contents of each cell in a list.
随后遍历集合中的元素以检索标题、描述、持续时间和用户评分,最后将信息格式化为一个有序列表。
It then iterates over the elements in the collection to retrieve the title, description, duration and user rating for each and formats this information as an ordered list.
对于面向对象系统来说,必须遍历对象集合并在集合中的每个元素上执行某个操作,是非常普通的使用情况。
It's a common use case for an object-oriented system to have to traverse a collection of objects and perform some action against each element in the collection.
清单7定义一个序列名,然后使用一个for子句遍历该序列,获取每个名称并将其添加到节点集合中。
Listing 7 defines a sequence of names, and then USES a for clause to loop through this sequence, retrieving each name and adding it to a node collection.
list控件的结构与for- each循环类似:它会遍历一个集合,对于集合中的每个项目,它都会进行渲染。
The list control construct is similar to a for-each loop: it iterates over a collection and for each item in the collection it renders its body.
清单14中定义的模板与为GroovyTestCase定义的模板类似,其中包括循环遍历一个集合的逻辑。
The template defined in Listing 14 looks similar to the template for GroovyTestCases, in that it includes logic for iterating over a collection.
即使对象加入到了集合中,原来的Iterator也可以进行,继续遍历原来集合中的项。
Even as objects get added to the collection, the original Iterator can proceed, working through the items in the original collection.
由for-yield表达式产生的集合类型会从被遍历的集合类型中推断。
The type of the collection resulting from a for-yield expression is inferred from the type of the collection being iterated over.
可能需要在遍历的过程中更改集合的元素。
You might need to change the elements of the collection in the middle of a traversal.
这个变量应该有自己的类型,这样,它就可以与将遍历的列表、数组或集合中的每一个项兼容。
This variable should be typed so that it's compatible with each item in the list, array , or collection being iterated over.
这个变量应该有自己的类型,这样,它就可以与将遍历的列表、数组或集合中的每一个项兼容。
This variable should be typed so that it's compatible with each item in the list, array , or collection being iterated over.
应用推荐