I find that style difficult to read and test, so I created a named inner class.
我发现这种风格难于读取和测试,所以我创建了一个有名称的内部类。
The code in Listing 1 would be much neater if the anonymous class was placed separately as an inner class.
如果这个匿名类可被作为一个内部类单独放置,那么清单1中的代码将会简洁很多。
He conducts a class dedicated to the understanding of 'intelligible and sensual design in inner and outer nature', first expounded by Immanuel Kant.
他带了一个班,专门致力于研究可识别的感官构思在内部和外部自然表现,这一概念首先是由康德阐述的。
This is an improvement over having to write a class any time an anonymous inner class is needed and can help keep the code more self-documenting.
相比于每个匿名内部类都要对应一个类的做法来说,这种方式是个极大的改进,同时也使得代码的可读性更好。
The recommended approach is to use static inner classes, if you must use an inner class at all.
推荐的做法是如果非要使用内部类的话,请使用静态内部类。
The first set of enclosing braces delineates the construction of an anonymous inner class, and the second set delineates the instance initializer for the anonymous inner class.
第一组闭合括弧划定一个匿名内部类的构造,第二组划定匿名内部类的实例初始化语句块。
The CICE proposal is a simpler proposal that addresses the problem that instantiating inner class instances is too cumbersome.
CICE方案要简单得多,它解决了实例化内部类实例不太灵活的问题。
Two things are worth mentioning when considering this code: First, the instantiation of an anonymous inner callback class requires a great amount of boilerplate code.
上面的代码有两点值得我们注意:首先,匿名内部回调类的实例化需要大量的样板代码。
This new inner class helps us to understand and use the following two pairs of new methods in thread.
新的内部类可以帮助我们了解下列两对新方法,并有助于我们在Thread中使用它们。
Here, the ActionListener implementation is defined in place, as an anonymous inner class, and directly attached to the button.
这里,ActionListener实现是适时定义的,它定义为一个匿名内部类,并直接附加到按钮上。
For example, the semantics of return, break, and this are different in a block of code than they are in a Runnable (or other inner class instance) that represents the same block of code.
比如,return、break和this在某一代码块中的语义与其在Runnable(或其他内部类实例)中同一代码块中的语义是不同的。
For each parameter that has a dependency on other parameters, add a PatternDependencyDelegate statement to the constructor of the parameter's dependency inner class (see Listing 3). In this case.
对于每个依赖于其他参数的参数而言,要为参数内部依赖类的构造函数增加PatternDependencyDelegate声明(参看列表3)。
You are returning an instance of JsonRecordWriter, an inner class that will get a line of data from Listing 3 and produce a line of data in Listing 4.
您正在返回一个JsonRecordWriter实例,这是一个内部类,用于从清单3获取数据并生成清单4中的一行数据。
Also at the time of this article? S writing, the JoinRowSetImpl class only implemented the ability to perform an inner JOIN like that showcased in this article.
同样是在本文编写之际,joinrowsetimpl类只实现了执行内join(也就是本文用例子展示的那种连接)的能力。
Often this means the proxy will need to be an inner class of Person to have access to private fields.
这通常意味着代理需要是Person的一个内部类,以便能访问private字段。
The MqttSimpleCallback interface is implemented with an inner class.
MqttSimpleCallback接口是使用内部类实现的。
An inner class is added to implement the MqttSimpleCallback interface, and the registration of that handler.
添加内部类以实现MqttSimpleCallback接口和回调处理程序的注册。
To change what our view displays, modify the default code for the ViewContentProvider inner class.
要更改视图显示,修改ViewContentProvider内部类的默认代码。
The OGAdmin class contains several inner classes.
ogadmin类包含多个内部类。
I'm left with some ugly boilerplate code because of the anonymous inner class wrapping this method's real purpose - the two lines of code that appear in the body of the addOrderFrom method.
考虑到包装这个方法的匿名内部类的真正用途,我留下了几行难看的样板代码—addorderfrom方法体中的两行代码。
The addOrderFrom() method collapses to the definition of an anonymous inner class creation of the command class, wrapping the two work items.
addOrderFrom()方法成为公共类的匿名内部类创建的定义,将这两个工作项目包装起来。
The only thing a class needs to be used this way is a default constructor (which allows you to create an anonymous inner class instance inheriting from your class).
惟一需要以这种方式使用一个类的是一个默认构造函数(它允许您创建继承自类的一个匿名内部类)。
This restriction is lifted in Groovy; you can change the values of variables in a containing scope from within an anonymous inner class.
Groovy则消除了这种限制,在Groovy中,匿名内部类可以修改外部的变量值。
An inner class has been implemented for query (lines 31-44) to map returned the ResultSet object to the User object.
为查询实现了一个内部类(31 - 44行)以将ResultSet对象映射到User对象。
The visitor is implemented in an inner class (aptly called Visitor).
访问者是在一个内部类(称为Visitor 比较好)中实现的。
Otherwise, an inner class will be created to store that element's contents (see name, phone and salary in Listing 9).
否则,将创建一个内部类来存储此元素的内容(见清单9中的name、phone和salary)。
Each of these is an abstract class, complete with two non-abstract inner classes called Double and Float (which are subclasses of the abstract outer class).
其中每一个都是抽象类,他们都是两个名为Double和Float的非抽象内部类(它们是抽象外部类的子类)。
The magnification itself is made by the MagnifiedIcon inner class (lines 95 through 113).
真正的放大工作是由 MagnifiedIcon这个内部类来做的(第95行到第113行)。
The inner class code calls these static methods whenever it needs to access the mValue field or invoke the doStuff method in the outer class.
内部类会在外部类中任何需要访问mValue字段或调用doStuff方法的地方调用这些静态方法。
For example, only final object references from the outer class are invokable within the body of the anonymous inner class.
例如,在匿名内联类的主体中,只能调用外部类中的final对象引用。
应用推荐