最后,我发现他们通过声明元素声明了很多全局变量(类实例变量)。
Finally, it dawned on me that they had declared many variables with global scope (class instance variables) via declaration elements.
如果将一个类实例变量赋给另一个类,它们不仅具有相同的数据类型,还在内存中指向相同的类实例。
If you assign one class instance variable to another, not only do they have the same data type, they point to the same class instance in memory.
不需要通过 read_inheritable_attribute宏来使用属性,因为这是ActiveRecord定义的类实例变量。
There's no need to go through the read_inheritable_attribute macro to use attributes because these are class instance variables defined by ActiveRecord.
不能将断言同实例的类变量声明一块使用,但却可以将其置于任何方法内。
An assertion cannot be used with class variable declarations for instance, but can be placed within any method.
在随后进行更改时,将视图部件实例的引用存储到一个类变量中。
In the change that follows, it stores a reference to the view part instance in a class variable.
这个回调处理器类拥有两个线程本地变量,用于存储来自客户端实例的用户ID和密码。
The callback handler class has two thread local variables that can store the user ID and password from the client instance.
这个类中的实例变量列表值得注意,因为它们定义了由分析过程生成的结果对象。
The list of instance variables in this class is worth noting because they define the result object that is generated by the analysis procedure.
在类定义之后添加以下实例变量,如清单1所示。
Add the following instance variables right after the class definition as shown in listing 1.
如果这是接口部分,那么输出所有类实例的变量。
If this is the interface pass, output all the class instance variables.
而这个业务对象在从boentity类继承的一个私有实例变量中封装Notes文档,这样可以保护任何对该文档及其项的直接访问。
This business object encapsulates the Notes document in a private instance variable inherited from the BOEntity class, so any direct access to this document and its items is prevented.
第一个也是最重要的新特性是针对类的方法和实例变量的访问保护 ——public、protected 和 private关键字。
The first and most important addition was access protection for methods and instance variables on classes -- the public, protected, and private keywords.
清单6提供了BuddyNoteView的实例和类变量。
Listing 6 provides the instance and class variables for BuddyNoteView.
这些变量不仅是私有的,而且只属于converter类的特定实例。
Not only are the variables private but they are private to the particular instance of the Converter class.
在您创建oneviewcontroller类时,您定义了实例变量来管理视图组件。
When you created the OneViewController class, you defined instance variables to manage the view components. These variables are.
它将实例变量声明为Bean实现(一个实际的类)的一部分。
The instance variables were declared as part of the bean implementation, which was a concrete class.
如果var属性存在,转换后的XML文件将分配给相应的scoped变量,作为or g .w3c . dom . document类的一个实例。
If the var attribute is present, the transformed XML document will be assigned to the corresponding scoped variable as an instance of the org.w3c.dom.Document class.
与实例变量不同的是,类变量与该类所有的对象关联在一起而非某个特定的对象。
Unlike instance variables, class variables are associated with all objects of a particular class and not with individual objects.
调用处理程序中会包含一个实际的实现类的实例,把它作为实例变量。
The invocation handler will contain an instance of a real implementation class as an instance variable.
因此一个类实例所具有的结构(和实例变量)是和它生命周期内发送给它的消息密切相关的。
So the structure (and the ivars) that an instance has depends on what messages it has been sent during its lifetime.
如果您想为一个类的所有实例维持一个变量的实例,将会用到静态类成员变量。
If you want to maintain a single instance of a variable for all instances of a class, you will use static-class member variables to do it.
问题出在拥有少量实例变量的类上。
The issue is for classes that have a small number of instance variables.
相反地,人们通过给Thread添加一个实例变量(该变量用于保存当前线程的从线程局部变量到它的值的映射的HashMap)来修改thread类以支持ThreadLocal。
Instead, the thread class was modified to support ThreadLocal by adding an instance variable to thread that holds a HashMap mapping thread-local variables to their values for the current thread.
第二个字段的类型为StaticLocalInitFlag,它在针对foo类的每个实例第一次执行方法时协助正确初始化变量i。
The second field, of type StaticLocalInitFlag, assists in initializing the variable I correctly the first time the method executes on each instance of class Foo.
DefaultDAO 类在静态变量instance 中存储了它自己的一个实例(存储为Singleton),并允许通过getInstance()方法访问该实例。
The DefaultDAO class stores an instance of itself (as a Singleton) in the static variable instance, allowing access to that instance through the getInstance() method.
这个类用于封装对两种类型的警报都通用的实例变量,其原因与ThresholdValues和thresholdinfo类中介绍过的相同。
This class encapsulates instance variables common to both types of alerts for the same reason as described above for classes ThresholdValues and ThresholdInfo.
虽然此组件在视图控制器类内不具有已分配的实例变量,但是您需要定义类delegate。
This component does not have an assigned instance variable inside the view controller class, but you need to define the class delegate.
TestsRulesEngine 类只有两个实例变量。
Field类本身相当简单;它几乎包含了这个字段的实例变量,访问这些变量的方法,一个toString方法,和一个标准的构造方法。
The field class itself is pretty simple; it pretty much consists of the instance variables of the field, accessor methods for those instance variables, a toString method, and a normal constructor.
要创建一个线程局部变量,请实例化类ThreadLocal的一个对象。
To create a thread-local variable, you instantiate an object of class ThreadLocal.
要创建一个线程局部变量,请实例化类ThreadLocal的一个对象。
To create a thread-local variable, you instantiate an object of class ThreadLocal.
应用推荐