How to use generic types in method signature?
如何在方法签名使用泛型类型?
Fix the bug: lifetime managers with open generic types.
修复bug:在生命周期管理器中使用泛型类型。
In the case of mixins as generic types, we can apply the same solution.
在mixin作为泛型类型的情况中,我们可以应用同样的解决方案。
Major refactoring internally to use generic collections instead of the non generic types.
在框架内部的重要重构使用了泛型集合类代替非泛型的集合性。
Let's start by reviewing the limitations on the use of generic types in Tiger and jsr-14.
让我们先查阅一下Tiger和JSR - 14中泛型类型的使用限制。
Learning to use generic types is quite straightforward, but there are also pitfalls to be avoided.
学习如何使用泛型类型相当简单,但是同样也需要避免一些缺陷。
Erasing in this manner introduces holes in the type system that limit how we can safely use generic types.
以这种方式进行擦除在类型系统中引入了缺陷,这些缺陷限制我们使用泛型类型的安全性。
Let's start off with an introduction to what generic types are and what features are being added to support them.
让我们从介绍泛型类型是什么以及添加了什么特性来支持它们开始吧。
The utility of wildcards in the type system comes partially from the fact that generic types are not covariant.
通配符在类型系统中的作用部分来自其不会发生协变(covariant)这一特性。
One thing to note is that I put the Origin type along with other generic types in a DataTypes schema (see Listing 2).
要说明的一点是,我将Origin类型连同其它一些通用类型一起放在了DataTypes模式中(请参阅清单2)。
With type erasure, generic types are used for type checking only; afterwards, they are replaced with their upper bound.
使用类型消除(type erasure),泛型类型仅用于类型检查;然后,用它们的上界替换它们。
Specifically, I'd like to talk about generic types and highlight the changes and tweaks in Tiger designed to support them.
我特别想谈谈泛型类型并重点讲述在Tiger 中为了支持它们而进行的更改和调整。
These built-in link relations are designed to cover the most common and generic types of links expected to be used with feeds.
这些内建的链接关系是为提要(feed)中可能使用的最常见、最一般的链接类型设计的。
To support mixins through generic types, we need to have run-time representations of the generic type instantiations available.
为了通过泛型类型支持mixin,我们需要获得泛型类型实例化的运行时表示。
By incorporating mixins using generic types, we are able to work around many of the key limitations of other formulations of mixins.
通过使用泛型类型合并mixin,我们能解决其它mixin公式的许多关键限制。
Starting from an initial class, the analyzer chains through all referenced classes, handling substitution of generic types as it goes.
该分析器从初始类开始将引用的所有类贯穿起来,在此过程中处理泛型类型的置换。
Dependent types are types parameterized by run-time values (compare this with generic types, which are parameterized by other types).
从属类型是运行时值参数化的类型(与泛型比较,泛型是其它类型参数化的类型)。
If these issues are not handled well, the benefits of generic types can easily be outweighed by decreases in expressiveness and robustness.
如果这些问题处理得不当,那么可表达性和健壮性的降低会轻易地抵消泛型类型的好处。
The Infer Generic Type Arguments refactoring automatically tries to guess the appropriate generic types for classes used in their raw form.
InferGenericTypeArguments重构会自动地为原始形式的那些类推测恰当的泛型类型(generic type)。
This technique is extremely powerful; we get almost all of the increased precision of generic types, but we maintain compatibility with the JVM.
这一技术的功能极其强大;我们可以使几乎所有泛型类型的精度得到增强,但又与JVM保持兼容。
It would be much better to simply prevent the programmer from referring to generic types in static fields, as is done in the case of static methods and classes.
象对静态方法和类所做的那样,只要防止程序员在静态字段中引用泛型类型,情况就会好很多。
The situation is worse for a programmer who isn't aware of the implementation scheme used for generic types in Tiger and just assumes that the type system ACTS reasonably.
对于不清楚Tiger中泛型类型所用的实现方案而又恰好假定类型系统合理运行的程序员而言,情况更糟。
Because I want to demonstrate decoding generic types for this column, the type information needs to include the specific parameter types used with a generic type reference.
因为我想在这一期中演示泛型的解码,所以类型信息需要包含泛型引用所使用的具体的参数类型。
Unfortunately, the complexity of generic types (including all the possible variations of bounds and such) means that signatures cannot be described as simply as the descriptors.
不幸的是,泛型的复杂性(包括可能出现的各种上下界变化等)意味着签名无法像描述符那样简单地说明。
We encourage you to read this article to help classify the type of portal project you are starting; however for our purposes we have boiled it down to three generic types of portals.
我们鼓励您阅读这篇文章,以帮助确定您要启动的门户项目的类型;然而,为了方便起见,我们已经将其归纳为三种普通的门户类型。
We'll relate such a formulation of mixins to previous discussions of this powerful language feature, discussing the advantages and disadvantages of adding mixins through generic types.
我们会将这种mixin的表现方式与先前讨论的这种功能强大的语言特性相关联,讨论通过泛型类型添加mixin的优缺点。
The Listing 9 output gives the basics of how generic types are parameterized for use, including the types of items specified for the m_files and m_directories lists in the DirInfo class.
清单9的输出给出了泛型类型是如何参数化使用的基本情况,包括为在dirinfo类中列出的m_files和m_directories项指定的类型。
The most visible change scheduled to occur in Tiger is the addition of generic types, as previewed in the JSR-14 prototype compiler (which you can download right now for free; see Resources).
Tiger中计划进行的最显著的变化是添加泛型类型,正如在JSR-14原型编译器中所预先展示的那样(您可以立即免费下载该编译器;请参阅参考资料)。
Of course, it would be a significant amount of work for the programmer to have to redefine all of the standard utility classes — such as Hashtable and List — just to be able to use generic types.
当然,程序员若只是为了能使用泛型类型而必须重新定义所有的标准实用程序类(比如Hashtable和List)的话,则可能会是一项浩大的工程。
Although generic types can be a powerful weapon for producing robust code, we've shown how their misuse can lead to code that is not only less robust but also extraordinarily hard to diagnose and fix.
尽管泛型类型是制作健壮代码的强大武器,但我们已经演示了误用它们会使代码不再健壮而且极难诊断和修正。
应用推荐