class n. 1.阶级;社会等级。 2.学级;班级,年级,级,班;组;(有组织的)讲习班;〔美国〕同年毕业班;【军事】同年入伍士兵。 3.(高低、优劣的)等级;类别。 4.〔英大学〕(荣誉考试)优等;〔俚语〕高级,优秀;漂亮,优雅。 5.【生物学】(分类学的)纲;【矿物】晶族。 6.(一节)课。 the working class工人阶级。 No class today. 今天没课。 C- is over. 下课。 boycott classes 罢课。 the first [second] class头[二]等。 high [low] class高[低]级。 There's a good deal of class about him. 他有很多优点。 He is not class enough. 他没有什么了不起。 at the top of one's class 出类拔萃;居首要位置。 be no class 〔俚语〕不足道;无价值。 class of the field 〔美国〕比赛的优胜候补人。 get a class=obtain a class. in a class by itself 特好,出众。 in class在上课中。 in the same class 〔美国〕同一类型的,同等的。 no class 〔俚语〕等外的,极坏的,蹩脚的〔用作表语〕。 not in the same class with 不能同…相比,无法和…相提并论,比不上…。 obtain a class=take a class 毕业考试得优等。 take a class at (Oxford) 在(牛津大学)进荣誉班。 take a class of (beginners) 担任(初级)班(的教师)。 take classes in (history) 听(历史)课,选修(历史)课程。 the classes 上层社会;知识阶级。 the classes and masses 各阶级和各阶层。 vt. 把…分类,把…分等[分级];给…定等级,把…分组。 vi. 属于…类[等、级、组]。 adj. -able 可分类[等级]的。 adj. -less 无阶级的。
Brian goetz explains some of the benefits of immutability and some guidelines for constructing immutable classes 中,briangoetz说明了不变性的一些长处和构造不变类的一些准则。
When writing a class, it is always worthwhile to ask yourself whether this class could be effectively implemented as an immutable class 在编写类时,问问自己这个类是否可以作为不变类有效地实现,总是值得的。
You can often avoid creating duplicate objects by using static factory methods in preference to constructors on immutable classes that provide both 对于同时提供了静态工厂方法和构造函数的非可变类,通常可以用静态工厂方法而不是构造函数来避免创建重复的对象。
Depending on your application, even abstract types that contain many discrete values-such as vectors or matrices-might be good candidates for implementing as immutable classes 甚至包含许多离散值的抽象类型(如向量或矩阵)也很适合实现为不变类,这取决于您的应用程序。
Constant data are obvious candidates for immutability, and objects with complex and frequently changing states are generally inappropriate candidates for implementation with immutable classes 常量数据显然符合不变性,而状态复杂且频繁更改的对象通常不适合用不变类来实现。
immutable classes are very useful for simplifying the design of object-oriented programs-immutable objects require less defensive coding and offer relaxed synchronization requirements 不变类对于简化面向对象程序的设计非常有用不变的对象只需要较少的防御性编码,并且不要求严格的同步。
Keyword was included in the java language to assist developers in creating immutable classes, and enable compilers and runtime environments to optimize on the basis of declared immutability 关键字是为了帮助开发人员创建不可变类,并允许编译器和运行时环境以声明的不可变性为基础进行优化。