The first couple of examples show this exact embrace of Gang of Four patterns in more modern Java-based languages, incorporating the Iterator and Command patterns directly into the language. 前几个例子展示了更为现代的基于Java的语言包含了四人组模式,该语言中直接包含了迭代器和命令模式。
The upsert iterator is the one that performs the actual updates or inserts and deletes. 迭代器upsert执行实际的更新或者插入及删除操作。
So with some effort, you can coax an object to behave like both a sequence and an iterator. 所以,通过某些措施,可以让一个对象同时表现得像序列和迭代器。
The familiar Python idiom for elem in lst: now actually asks lst to produce an iterator. Python常见的习惯用法foreleminlst:现在实际上让lst产生一个迭代器。
Of course, there is a trade-off between memory used and the speed penalty of running through the iterator. 当然,在使用迭代器时,要在占用的内存和速度之间有所取舍。
You can use the for loop with any Python object that provides an iterator, including the built-in sequence types such as the tuple, string, and list. 可以将for循环与提供迭代器的任何Python对象结合使用,这些对象包括tuple、string和list等内置序列类型。
Creates a collection and later an iterator to loop through. 创建了一个集合和一个用于遍历的迭代器。
This example demonstrates three means for iterating through a dictionary: by using the Python iterator returned from the iterkeys(), itervalues(), or iteritems() methods. 这个示例演示了遍历dictionary的三种方式:使用从iterkeys()、itervalues()或iteritems()方法返回的Python迭代器。
Furthermore, it also gets an iterator from the ArrayList and scans through the collection from start to finish. 而且,还从ArrayList获得了迭代器,并从头到尾对集合进行了扫描。
In Blue, ignoring recursion or map ( functional iterator), there's one way to implement loop constructs. 而在Blue中,忽略了递归或映射(函数迭代器),只有一种方法来实现循环结构。
The main problem is that we create a new copy of the iterator every time. 主要问题是,每次都要创建迭代器的一个新副本。
The pre-call to itertools. tee() preserves the original iterator. 对itertools.tee()的预调用保留了原始迭代器。
In PHP parlance, this means that the object can be treated as an iterator. 在PHP中,这意味着对象可以当做迭代器。
An iterator's.next() method might decide to raise a StopIteration exception if the iteration has a logical termination. 如果迭代有一个逻辑终止,则迭代器的.next()方法可能决定抛出StopIteration异常。
The Phar:: buildFromIterator() method accepts the iterator object itself as the sole argument. buildFromIterator()方法接受迭代器对象本身作为惟一的参数。
Then the upsert iterator updates the rows that have joined and inserts the rows that are null extended into target table based on insert clause specification. 然后,upsert迭代器将更新已经连接的行,并基于insert子句规范将空扩展行插入到目标表中。
Both the matched and non-matched rows are fed into the upsert iterator. 匹配与未匹配行都被送入upsert迭代器中。
You create a definitions object and map it inside an iterator, then do something similar for synonyms. 创建一个definitions对象,并在迭代中映射它,接着用同样的方法处理synonyms。
JDOM represents strings as Java Strings, and collections of nodes via normal List and Iterator classes. JDOM将字符串表示成JavaString,并且通过普通的List和Iterator类来表示节点的集合。
SQLReader also has to implement a hasNext() method ( not shown) to complete the iterator interface. SQLReader还必须实现hasNext()方法(这里未显示)以便完成迭代器接口。
Such unique features include iterator blocks, parallel assignment, and oddities like the Range class. 这些独特的特性包括iterator块、并行赋值和像Range类这样奇妙的东西。
You'll recall from previous articles in this series that closures are commonly used with iterator methods applied to List and Map collections. 您会回忆起这个系列以前的文章中,闭包一般用于在List和Map集合上应用的迭代器方法上。
You can easily modify the Rope iterator to accommodate skipping forward by more than one character at a time. 很容易就能将Rope迭代器改成一次向前移动不止一个字符。
Use the function odbc_result(), which takes in a result set and a column name ( as a string) and returns the cell value within the row that the row iterator points to. 使用函数odbcresult(),该函数接受结果集和列名称(字符串形式),并返回行迭代程序所指向的行中的单元值。
The iterator pattern provides a way to encapsulate looping through a collection or array of objects. 迭代器模式将提供一种通过对象集合或对象数组封装迭代的方法。
A random access iterator is an iterator that can read through a sequence of values. 随机访问迭代器是一种可以读入一组值的序列的迭代器。
This implementation iterates over the specified collection, and adds each object returned by the iterator to this collection, in turn. 对指定集合进行遍历,依次向当前集合添加每一个由迭代器返回的对象。
In the example above, the type returned by v.begin() and v.end() is vector:: iterator. 在上面的例子中,这个类型返回的v.begin()和v.end()是vector::iterator。
A Return statement within an anonymous Iterator works just like C#'s yield return. 在匿名迭代器中的Return语句工作方式就像C的yieldreturn一样。
You can use the table below to find the right types based on the type of your iterator. 你可以用下表基于你的迭代器类型来找到正确的类型。