不像通常的例子集合,它们更多的关注于一个人如何使用某个函数库,而不是简单的演示这个函数库能干些什么。
Unlike the usual collections of examples, their focus is more on how one should use a given library than simply showing what is possible.
您已经见过了几个对集合进行迭代的例子。
You've seen several examples of closures that iterate over collections.
接下来给出的例子是第二次世界大战,这个名称在出版物中有很多种不同的写法,但是LCSH的一条标目把这些写法都集合到一起。
The example given is that of World War II, which can be called by many different names in publications, but is brought together under a single heading in LCSH.
用例图经常被分组来显示涉众们的需求集合(请看图1中的例子)。
Use case diagrams (see Figure 1 for an example) are often grouped to show a collective set of stakeholder needs.
集合安全组件的一个例子是企业中的部门。
An example of set security component is the departments in an organization.
例子:创建领域集合(即本主题)。
清单3中所示的例子有两个集合,一个只接受AtomEntryDocuments,另一个只接受图像文件(如png、GIF、JPEG等)。
The example in Listing 3 has two collections, one that accepts only Atom Entry Documents and one that only accepts image files (such as PNG, GIF, JPEG, and others).
正如你在例子中看到的,UImodule是嵌套的UI元素、tag以及attribute的集合。
As shown in this example, the UI module is a set of nested UI elements with tags and attributes.
由于所有数据都是唯一的,因此字母表集合不是一个合适的例子。我们向本文开头创建的 colors 集合中添加一些记录(参见清单18)。
Our alphabet collection is a bad example as all the data is unique, so let's add a couple of records to the colors collection we created earlier in this article (see Listing 18).
这里也留下了一个嵌套数据的例子,说明可以自由地将一个集合嵌套在另一个集合中。
I also left in an example of nested data just to show that you may freely nest collections inside each other.
比如它自动把所有值作为集合以供遍历等,正如我们的例子所示。
It automatically manages the values as a collection that you can iterate over, etc., as in our examples.
还有另外一种场景需要考虑集合声明的使用,比如valmap = Map(),就像下面这个例子。
There is another scenario to watch for when using declarations of collections like val map = Map(), as in this example.
在清单1中的例子中,使用了pureQuery的内联方法来实现这样的过滤,但是,DAOs和内联方法都可以提供集合上的查询。
The example in Listing 1 shows an example of inline methods to achieve this filtering, but queries over collections are available for both DAOs and inline methods.
在这个例子中,{1;2;3;4}就是这个集合。
在这个例子里,返回类型是seq [string],seq (sequence)是一种特殊的集合。
In this case, the return type is seq [String], where seq (" sequence ") is a particular kind of collection.
前面的例子使用了一个空循环,如果在循环中访问集合元素,会发生什么?
The previous example used just an empty loop, but what happens when the elements of the collection are accessed within the loop?
在这个例子中,我们有两个状态集合,可观察的状态和隐状态。
In this case we have two sets of states, the observable states and the hidden states.
但是为了编写高效的程序,你需要扩展该简单的例子来包含相关对象的集合。
But to write efficient programs, you need to extend that simple example to include the right set of related objects.
一个例子是“资料表”集合。
举个例子,假设你需要写一个工具方法来执行数据库查询,比如SQL串,并且返回满足这个查询的数据库中的对象的集合。
For example, suppose you need to write a utility method that performs a database query, given as a string of SQL, and returns a collection of objects in the database that match that query.
作为使用下界通配符的最后一个例子,让我看看方法Collections.max,返回传递给它作为参数的集合的最大元素。
As a final example of using lower bounded wildcards, lets look at the method Collections. Max , which returns the maximal element in a collection passed to it as an argument.
作为使用下界通配符的最后一个例子,让我看看方法Collections.max,返回传递给它作为参数的集合的最大元素。
As a final example of using lower bounded wildcards, lets look at the method Collections. Max , which returns the maximal element in a collection passed to it as an argument.
应用推荐