这其中的很多方法都可以泛型化,以处理非wsdlXML文档。
Many of these approaches could be generalized to work with non-WSDL XML documents as well.
当然,由于这种类别不能在多种资料型别中重复使用,而就无法发挥泛型化的优点,且必须替每种需要储存的型别重新撰写类别。
Of course, because such a class is not reusable for more than one data type, you lose the benefits of generalization, and you have to rewrite the class for each type that will be stored.
从属类型是运行时值参数化的类型(与泛型比较,泛型是其它类型参数化的类型)。
Dependent types are types parameterized by run-time values (compare this with generic types, which are parameterized by other types).
同样,实例化泛型类的客户机类必须使用满足对构造函数存在所声明的约束的类来这样做。
Also, client classes that instantiate our generic class must do so with classes that meet the declared constraint on what constructors exist.
有时我们想限制可能出现的泛型类的类型实例化。
Sometimes we want to restrict the potential type instantiations of a generic class.
答案取决于这样的事实,您常常需要创建泛型库,以及对于某些具体类型,您希望避免泛型行为和拥有特殊化的实现。
The answer lies in the fact that you often need to create generic libraries, and for some specific types, you want to avoid the generic behavior and have a specialized implementation.
可以将泛型类型看作是类型“函数”;它们通过类型变量进行参数化,这些类型变量可以根据上下文用各种类型参数进行实例化。
Generic types can be thought of as type "functions"; they are parameterized by type variables that can then be instantiated with various type arguments depending on context.
泛型类可被视为将它们的参数映射成新实例化的函数。
Generic classes can be viewed as functions mapping their arguments to new instantiations.
处理该问题的另一种方法是:只要泛型类的运行时实例化没有包括所需构造函数,就抛出异常。
Another way of handling this problem would be to throw an exception whenever a run-time instantiation of the generic class does not include a needed constructor.
因为查找器方法是特定于每个域对象的,因此将其应用于泛型DAO的类型化接口。
Because the finder methods are specific to each domain object, they are applied to the typed interfaces of the generic DAO.
只要泛型类的运行时实例化没有包括所需的构造函数,就抛出异常。
Throw an exception whenever a run-time instantiation of the generic class does not include a needed constructor.
不能用基本类型实例化泛型类型参数。
Generic type parameters can't be instantiated with primitive types.
再提一次,那是因为一个泛型类可以用其自己的类型参数来实例化另一个泛型类。
Again, that's because one generic class may instantiate another with its own type parameters.
对程序可以产生的泛型类的实例化数目设置上限。
Place an upper limit on the number of instantiations of a generic class that a program can make.
我们对程序可以产生的泛型类的实例化数目设置上限。
We could put an upper limit on the number of instantiations of a generic class that a program can make.
表示不变量的另一种方法是泛型-作为其它类型参数化的类型来支持类型系统(本专栏中最近一系列文章的主题)。
Another approach to expressing invariants is to bolster the type system with generic types, types parameterized by other types (the topic of our the most recent series of articles in this column).
当初始化代码就绪后,我们取得代表talks的成员变量,然后检查泛型信息是否正确:正确! talks是一个List,但是它是一个talk的List。
Once this setup code is ready, we retrieve the field representing the talks, and we check that the generic type information is correct: yes, talks is a List, but a List of talks.
getSignatureInstance()方法实际地构建新的泛型类模板,然后为参数类型的具体列表实例化这些模板。
The getSignatureInstance() method is what actually builds new generic class templates and then instantiates these templates for specific lists of parameter types.
为了通过泛型类型支持mixin,我们需要获得泛型类型实例化的运行时表示。
To support mixins through generic types, we need to have run-time representations of the generic type instantiations available.
清单9的输出给出了泛型类型是如何参数化使用的基本情况,包括为在dirinfo类中列出的m_files和m_directories项指定的类型。
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.
当泛型类在其自己的主体中实例化其本身时,发生多态递归。
Polymorphic recursion occurs when a generic class instantiates itself in its own body. For example, consider the following devious example.
所以在清单11 中,针对数组的特殊化版本将派生自 true-type,而泛型版本将派生自 false-type。
So in Listing 11, the specialized version for arrays would be derived from true-type, while the generic version would come from false-type.
这么做很好,但是没有真正利用到Tiger的另一项特性——泛型(有时也叫作参数化类型)。
This is nice, but doesn't really take advantage of another important Tiger feature: generics (sometimes called parameterized types).
在您通过泛型使用类型化列表时,也有可能做到这点。
The same is possible when you use typed lists, via generics. Listing 12 shows a few simple parameterized collections.
泛型允许类,结构,接口,代理还有方法被他们存储和操作数据类型参数化。
Generics permit classes, structs, interfaces, delegates, and methods to be parameterized by the types of data they store and manipulate.
通过实例分析,说明了泛化与泛型在面向对象分析与设计中的重要作用。
Through the analysis of instances, the significance of generalization and genericity in object-oriented analysis and design is obviously shown.
无法实例化基于局部类型或未命名类型的泛型或模板类。
You cannot instantiate a generic or template class based on a local or unnamed type.
因此,如果开发人员使用CER的共用执行个体化,将不会拦截 JIT 编译错误、泛型型别载入错误,或是预期的 CER 之区域内的执行绪中止。
So if the developer uses a shared instantiation of the CER, then JIT-compilation errors, generics type loading errors, or thread aborts within the region of the intended CER are not caught.
是否要将泛型行为因数化至基底类别和子类别。
Whether to factor generic behavior into base classes and subclasses.
可以添加、删除或更改泛型类型的实例化或对现有泛型方法的调用。
Instantiation of a generic type or calls to existing generic methods can be added, deleted, or changed.
应用推荐