If you have an immutable object, you must set whatever state it will contain in the constructor.
如果您有一个不可变对象,则必须要在构造函数中设置该对象将包含的任何状态。
Only the parent and style are set in the constructor; all other properties are set on the created object.
只有父控件和样式是在构造函数中设置的,其他所有属性都是在已创建的对象上设置的。
This parameter is passed on the object constructor to mandate that it is set.
此参数在对象构造函数上传递,以强制设置该参数。
These class variables (shown in Listing 1) get set in the class's constructor, as shown in Listing 2.
这些类变量(如清单1所示)在类的构造函数中进行设置,如清单2所示。
Thus, most controls also have a second constructor argument, often called style, that provides flags to set these options.
因此,大多数控件还有另外一个构造函数参数,我们通常称之为样式,该参数提供了设置这些选项的标记。
The mapping object is allocated in the constructor (set in italics).
映射对象由构造方法来分配(见其中的斜体部分)。
You know that Set has a copy constructor.
您知道Set有一个拷贝构造函数。
These properties can be specified as system properties or, if needed, they can be set within a properties object and passed to UDDIProxy in a new constructor.
这些属性可以作为系统属性来指定,如果需要,还可以在属性对象中设置它们,并传送到新构造器的UDDIProxy。
I can set the assembler I want in the constructor, but I need to return a normal ModelMBean if the assembler is changed.
可以在构造函数中设置所需要的装配器,但是当装配器改变时需要返回一个普通ModelMBean。
When the String constructor runs, the length and offset are then set to their desired values.
当String构造器运行时,字符串长度和偏移量被设置成所需要的值。
The creator attribute here is set to the value new, meaning that DWR should call the class's default constructor to obtain an instance.
这里的creator属性被设置为值new,这意味着DWR应当调用类的默认构造函数来获得实例。
As you can see in Listing 4, the RulesEngine class's constructor takes as an argument a string value that represents the name of the file that contains a set of business rules.
在清单4中可以看到,rulesengine类的构造函数接受字符串值形式的参数,该值表示包含业务规则集合的文件的名称。
Much of that is because the test program is set up in a way that is pretty modular—with a constructor and init() method—so you can easily reuse this code for your own purposes without lots of changes.
主要是因为该测试程序按照非常模块化的方法编写 —使用构造函数init()方法 —以便不需要很大修改就能用于您自己的程序。
Instead, you can pass in the GuiTestObject to the constructor once, and then use the methods to set and get the text as instance methods instead of class methods.
可以将GuiTestObject只传递到构造函数中一次,然后将设置和获取文本的方法用作实例方法,而不是用作类方法。
To add elements to a set, we can either call add() for each element, or create a Collection and pass that to the constructor.
要向集中添加元素,我们可以为每个元素调用add() ,或创建一个Collection并将它传递到构造函数。
We set the trace option in an options array parameter, which we pass to the SoapClient constructor. We modify our use of the constructor to.
我们在options数组参数中设置trace选项,将该参数传递给SoapClient构造函数。
But the fact that they are all gathered together in the constructor keeps things neat and tidy, and dropping the set prefix and the parentheses at the end reduces visual noise considerably.
但是,设置器方法都集中在构造器中,代码更简洁了,去掉set前缀和末尾的圆括号也大大减少了视觉干扰。
Then set options as arguments to the constructor.
然后,通过构造函数的参数来设置选项。
The constructor function has no parameters and returns an instance of the type with all of its attributes set to null values.
构造函数没有参数,并且返回的类型实例中的所有属性都为空。
Because this bean definition is abstract, I can reuse the definition a number of times later and set the constructor argument to a suitable domain class.
因为该bean定义是抽象的,所以我将来可以无数次地重用该定义,并将构造函数参数设置为合适的域类。
The constructor USES these parameters to set its own properties. Here is how you might now instantiate a Dictionary object.
构造函数使用这些参数来设置自有属性。
I've successfully grafted in a call to the added code at each store into the Bean.m_a field (one in the constructor and one in the set method).
我成功地在每一次存储到Bean . m_a字段时,加入了一个对添加的代码的调用(一次是在构造函数中,一次是在set方法中)。
This is done in the constructor so all one needs to do is not set them.
这是在构造一个使所有需要做的不是设置它们。
You can also set properties on an object during the construction of the object by using the property names and assigning values just as you use named constructor arguments.
通过像使用命名构造函数参数一样使用属性名称并赋值,您也可以在对象构造过程中为对象设置属性。
If you want your derived class to set this property, you should do so within the static constructor or in other initialization routines.
如果您希望派生类设置此属性,则应该在静态构造函数或其他初始化例程中完成此工作。
Each class should have an appropriate constructor, data members to set and read methods.
每个类都应有合适的构造方法、数据成员的设置和读取方法。
You could still accidentally use a private constructor (e. g. in a restricted set of scopes), but the compiler will forbid you from ever using a deleted constructor.
你仍然可以不小心使用了私有的构造方法(例如,在一组限制的范围),但编译器将禁止你使用过删除构造函数。
In class-based languages a new instance is constructed through the class's constructor and an optional set of constructor arguments.
在基于类的语言中,一个新的实例通过类构造器和构造器可选的参数来构造,结果实例由类选定的行为和布局建立模型。
Illustrates how to use inheritance to add a common set of properties and methods to objects created with a given constructor function.
阐释如何使用继承将一组通用属性和方法添加到用给定构造函数创建的对象。
The constructor will set the credit limit instance variable to be equal to that specified as a parameter.
构造器会把该实例变量(即信用限制)设为一个参数。
应用推荐