Step now into the world of generics.
现在进入泛型的世界。
Listing 3 Implementing Factory using generics.
表3使用泛型实现工厂模式。
No wonder generics firms are growing in confidence.
难怪仿制药公司越来越有信心。
Create a collection framework making use of generics.
利用泛型创建集合框架。
Piramel, based in India, is a branded generics company.
位于印度的Piramel公司是一家生产著名品牌通用药物的企业。
After three articles on generics, I'm ready for a change of topic!
在三篇关于泛型的文章之后,我要换一个主题了!
Pfizer has set up an in-house division to handle such generics.
Pfizer已经建立了一个内部机构来处理这些学名药。
For this article, I assume you already know the basics of generics.
对于本文,假定您已经了解泛型的基本知识。
This illustrates that generics in C# are not like templates in C++.
这个C#里 泛型 的例子并不像C++里面的 模板 。
Simply put, generics provide compile-time type safety for collections.
简单来说,泛型为集合提供了编译时类型安全。
Let's see how annotations, enums and generics can be used from Groovy.
让我们看看在Groovy中如何使用注解,枚举和泛型。
Listing 14. Listing 10 can be rewritten to take advantage of generics.
可以利用泛型重写清单10。
Listing 1. Sample code for the library system modeled using generics.
表1.使用通用类型建立图书馆系统模型的范例代码。
Note: This article assumes familiarity with the basics of generics in JDK 5.0.
注意:本文假设您对JDK 5.0中的范型有基本的了解。
Notice that JRE 5 defines the use of generics, specifying the type of collection.
注意,JRE5定义泛型的使用,指定集合的类型。
Do that and suddenly your code is 80 percent generics, annotations, and enumerations.
如果这样做,那么您的代码就会突然之间有80%是泛型、标注和枚举。
Last time, I showed how you can use runtime reflection to access generics information.
在上一期中,我为您介绍了如何使用运行时反射来访问泛型信息。
Using generics and annotations, support for lists of other types could be easily added.
通过使用泛型和标注,很容易添加对其他类型的列表的支持。
Earlier this month, America's FTC extended its probe to include generics companies.
这个月早些时候,美国的联邦贸易委员会将这项调查扩大到了非专利药公司。
The big drug firms point out that authorised generics drive down the price of copies.
大制药公司指出,授权的仿制药能够压低仿制品的价格。
You can easily alter it to not use generics if you like, then it will run with older JDKs.
如果愿意,您可以容易地改变它以不使用泛型,然后它将用较旧的JDK运行。
Only the month before GSK had acquired 16% of Aspen, a South African maker of generics.
仅一个月前,葛兰素史克获得南非仿制药制造商阿斯彭(aspen) 16%的股份。
All of the specific factories are implemented using generics - ControlsFactory class.
所有的具体工厂都由泛型类——ControlsFactory实现。
Like many big pharmas facing a generics threat, Pfizer is slimming down and restructuring.
辉瑞和其它大制药公司一样都面临着非专利药的威胁,辉瑞公司正进行战略性收缩和重塑。
Two such missing features are exceptions and generics, both very helpful in other languages.
这当中两个缺失的特性就是异常和泛型,两者在其它语言当中都是非常有用的。
One task for physicians, however, is to instill confidence in patients regarding generics.
对内科医生的任务之一,是对病人传递出对非专利药物的信心。
To put this into practice, let us check if the generics information is kept on class fields.
为了实践这些理论,让我们检查泛型信息是否保存在类的成员变量中。
The list of drugs includes only 143 different medicines and excludes many popular generics.
降价药品目录中仅包含143种不同的药品,许多常用的普通类药品都不在降价之列。
As you can see in Listing 6, generics are once again leveraged to make all of this code type safe.
从清单6中可以看出,我们再次利用泛型来使所有这些代码类型安全。
应用推荐